Skip to main content
v2026.11,986 entries · CC-BY 4.0

Count Colonies in ImageJ: Step-by-Step Guide

Count colonies in ImageJ with automated particle analysis, binary thresholding, and watershed separation, plus step-by-step menu paths and output metrics.

Written and maintained by CASRAI Editorial Board

Published · Last updated

On this page

To count colonies in ImageJ, convert your agar plate image to 8-bit grayscale via Image → Type → 8-bit, isolate the active culture area with the circular selection tool, apply a binary threshold under Image → Adjust → Threshold to highlight colonies against the agar background, separate touching colonies using Process → Binary → Watershed, and quantify colony numbers and morphometrics through Analyze → Analyze Particles by defining size and circularity filters. This automated particle analysis workflow delivers reproducible, objective colony counts alongside surface area distributions and spatial coordinates for microbiological assays, clonogenic survival experiments, and plaque assays.

What ImageJ is used for in research

ImageJ is an open-source scientific image processing application developed by the National Institutes of Health (NIH) and the Laboratory for Optical and Computational Instrumentation (LOCI). In biomedical and microbiology research, ImageJ provides a validated framework for optical densitometry, cell tracking, morphological profiling, and automated particle enumeration. The platform supports peer-reviewed plugins and macro scripting, allowing laboratory teams to analyze brightfield culture plate images and complex multidimensional fluorescence stacks.

Automated colony counting addresses critical requirements across multiple experimental domains:

  • Microbiological viable cell counts: Quantifying bacterial or fungal colonies on nutrient agar plates to determine colony-forming units per milliliter (CFU/mL) for antimicrobial susceptibility testing and environmental monitoring, directly complementing standard agar plate colony counting protocols.
  • Clonogenic survival assays: Measuring the reproductive integrity of mammalian cells following ionizing radiation or chemotherapeutic exposure, where surviving colonies are defined as aggregates of 50 or more cells.
  • Yeast spot dilution assays: Assessing colony density and growth inhibition across serial dilutions on selective agar plates in high-throughput genetic screens.
  • Viral plaque assays: Enumerating localized lysis zones within confluent cell monolayers to compute plaque-forming units per milliliter (PFU/mL).

Automated enumeration in ImageJ eliminates visual fatigue and operator subjectivity inherent in manual counting, while establishing a documented digital record of segmentation thresholds, spatial coordinates, and particle area distributions.

How to install or access ImageJ

Researchers can access ImageJ through two official distributions: classic NIH ImageJ (ImageJ 1.x) and Fiji (Fiji Is Just ImageJ).

Selecting between ImageJ and Fiji

Classic ImageJ provides a compact application core maintained by Wayne Rasband and the NIH community. Fiji incorporates the identical ImageJ processing engine while bundling native Java runtimes, an integrated script editor, an automated updater, and life science toolkits such as Bio-Formats for microscope file handling. For plate counting, both distributions run the Particle Analyzer and Watershed algorithms identically; Fiji simplifies library management when using external plugins like ColonyArea or Cell Counter.

Official installation steps

Both packages are freely available from their official project repositories:

  • Windows: Download the official 64-bit distribution archive. Extract the contents into a local user folder (such as C:ImageJ), avoiding restricted system directories like C:Program Files where Windows User Account Control (UAC) can impede automated plugin updates. Launch the application via ImageJ-win64.exe.
  • macOS: Download the distribution package matching your system architecture (Apple Silicon ARM64 or Intel x86_64). Mount the .dmg archive, drag the application bundle to /Applications, and launch using Control-click on first execution to confirm security permissions.
  • Linux: Download the 64-bit .tar.gz archive, extract the files to your software path (such as ~/bin/fiji), and execute ./ImageJ-linux64 via terminal.

Configuring memory allocation

High-resolution plate photographs often exceed 20 to 50 megapixels. To avoid Java heap memory errors during batch operations, configure system memory after initial installation:

  1. Navigate to Edit → Options → Memory and Threads….
  2. Set the “Maximum memory” value to 60% to 75% of available physical RAM (for example, enter 12000 MB on a 16 GB workstation).
  3. Retain the default thread count matching your detected CPU cores, click OK, and restart ImageJ.
  4. Select Help → Update… to verify that core packages match the latest official releases.

How to count colonies in ImageJ step by step

Automated colony counting relies on intensity thresholding and connected-component particle analysis. Ensure original photographs are acquired under uniform, diffuse lighting to prevent dish glare, observing plate preparation principles detailed in streak plate vs spread plate preparation.

Step 1: Open the plate image and calibrate scale

Open the photograph via File → Open… or by dragging the file onto the ImageJ toolbar. Supported formats include uncompressed TIFF, PNG, JPEG, and camera RAW.

To record colony dimensions in physical metric units rather than raw pixels, calibrate the spatial scale:

  1. Select the Straight Line selection tool from the main toolbar.
  2. Draw a straight line across a known physical dimension, such as a millimeter ruler placed adjacent to the plate or across the internal diameter of a standard 90 mm petri dish.
  3. Navigate to Analyze → Set Scale…. The pixel distance is entered automatically.
  4. Input the known physical length in the “Known distance” field (e.g., 90) and set the “Unit of length” to mm.
  5. Click OK to confirm. Subsequent colony surface area and perimeter calculations will display in calibrated units.

Step 2: Isolate the agar plate region of interest

Dish sidewalls, condensation droplets, meniscus reflections, and external handwriting interfere with automated counting. Clear these extraneous regions before segmentation:

  1. Select the Oval Selection tool on the toolbar.
  2. Hold the Shift key while dragging to constrain the selection to a true circle.
  3. Align the circle just inside the agar meniscus rim to encompass all active colonies while excluding the plastic dish wall.
  4. Navigate to Edit → Clear Outside. This replaces all pixels outside the circle with the background color, eliminating edge artifacts.

Step 3: Convert to 8-bit grayscale and equalize illumination

ImageJ segmentation algorithms require single-channel 8-bit grayscale data:

  1. Navigate to Image → Type → 8-bit. For color photographs, ImageJ computes luminance across RGB channels (0.299 Red + 0.587 Green + 0.114 Blue).
  2. If uneven illumination, vignetting, or center-to-edge gradients exist, select Process → Subtract Background….
  3. Enter a “Rolling ball radius” larger than the diameter of the largest colony on the plate (typically 50 to 100 pixels).
  4. Check Light background if colonies appear darker than the agar medium (e.g., crystal violet stained plates); leave unchecked if colonies are brighter than the agar.
  5. Click OK to flatten background variations across the dish, following core steps used in leaf area measurement in ImageJ.

Step 4: Segment colonies using binary thresholding

Thresholding separates foreground colonies from the agar substrate:

  1. Navigate to Image → Adjust → Threshold… (or press Ctrl+Shift+T / Cmd+Shift+T).
  2. The histogram window displays intensity distributions with adjustable cutoff sliders, with highlighted foreground regions appearing in red.
  3. Select an automated thresholding method from the dropdown. While “Default” suits high-contrast plates, Otsu, Yen, or Triangle provide robust results across biological plates with subtle contrast differences, demonstrating intensity-based image segmentation methods.
  4. Configure the Dark background checkbox: check it when colonies are light objects on a dark background; uncheck it when colonies are dark spots on a light agar field.
  5. Click Apply to generate an 8-bit binary mask where colonies appear as discrete foreground objects against a contrasting background.

Step 5: Separate touching colonies with the binary watershed transform

Colonies growing in close proximity frequently coalesce into fused clusters that automated tools misinterpret as single particles. ImageJ separates adjacent colonies using the Euclidean Distance Map (EDM) watershed transform:

  1. If hollow voids exist inside segmented colonies, select Process → Binary → Fill Holes.
  2. Navigate to Process → Binary → Watershed.
  3. The watershed algorithm calculates an EDM from the background boundary, identifies local distance maxima (Ultimate Eroded Points) corresponding to colony centers, and dilates them until touching edges meet at topographic saddle points.
  4. The algorithm draws a 1-pixel wide separation line between touching colonies, resolving individual boundaries without distorting colony morphology.

Step 6: Configure measurements and execute Analyze Particles

Configure output parameters and execute the particle counting scan:

  1. Navigate to Analyze → Set Measurements…. Enable Area, Centroid, Perimeter, Shape descriptors, and Mean gray value. Click OK.
  2. Navigate to Analyze → Analyze Particles….
  3. Define filtering parameters:
    • Size: Set a lower area cutoff (e.g., 20-Infinity pixels) to exclude single-pixel noise, dust specks, and agar debris.
    • Circularity: Set the range to 0.40-1.00. True microbial colonies are predominantly circular; this setting filters out irregular scratches, fibers, and residual meniscus arcs.
    • Show: Select Outlines or Overlay to inspect detected objects visually.
    • Options to check: Check Display results, Clear results, Summarize, and Include holes. Leave “Exclude on edges” unchecked when using an internal circular ROI.
  4. Click OK to execute the automated analysis.

Step 7: Manual counting and verification with the Cell Counter plugin

On plates with mixed microbial species, irregular morphologies, or dense clustering where automated segmentation is impractical, use the built-in Cell Counter plugin:

  1. Navigate to Plugins → Analyze → Cell Counter (or Plugins → Cell Counter in Fiji).
  2. Click Initialize on the active image.
  3. Select Type 1 for primary colonies and click directly on each colony on the screen to place a colored marker and increment the tally.
  4. Select Type 2 to enumerate secondary phenotypes, small colony variants, or contaminants.
  5. Use Delete mode to remove erroneous clicks if needed, and click Results to export tallies per category into a table, maintaining data tracking conventions used in colocalization analysis in Fiji.

How to read the output

The Particle Analyzer generates three complementary output windows: the Summary window, the Results table, and the Outlines overlay.

The Summary window

The Summary window reports aggregate population statistics for the evaluated plate:

  • Count: Total number of distinct colonies satisfying size and circularity thresholds.
  • Total Area: Cumulative surface area occupied by all detected colonies in square pixels or calibrated physical units (mm²).
  • Average Size: Mean colony surface area, useful for evaluating antimicrobial inhibition or growth rate differences across experimental treatments.
  • %Area: Percentage of the total active plate surface covered by colonies, a key endpoint in clonogenic cytotoxicity assays.

The Results table and shape descriptors

The Results table provides individual metrics for each detected colony from 1 to N:

  • Area: 2D projected surface area of the individual colony.
  • X and Y Centroid: Exact coordinates of the colony center of mass, enabling spatial clustering and neighbor distance analysis.
  • Circularity: Calculated as 4π × (Area / Perimeter²). A circularity of 1.0 indicates a perfect circle. Standard colonies typically register between 0.70 and 0.95; values below 0.40 indicate irregular clumps or elongated debris.
  • Aspect Ratio (AR): Major axis divided by minor axis of the fitted ellipse. Values near 1.0 reflect circular objects; values exceeding 1.5 suggest unresolved doublets.
  • Roundness: Calculated as 4 × Area / (π × Major Axis²), reflecting circular geometry independent of boundary roughness.
  • Solidity: Colony area divided by convex hull area. Values near 1.0 indicate smooth margins; lower values reflect irregular or lobed borders.

The Outlines window

The Outlines window displays numbered black boundaries of every counted colony over a blank or overlay canvas. Cross-reference this display with the original photograph to confirm that doublets are cleanly cleaved, true colonies are indexed, and dust particles remain uncounted.

Converting counts to biological concentrations

Convert raw ImageJ counts into standard biological metrics:

Microbial concentration (CFU/mL):

CFU/mL = (ImageJ Colony Count × Dilution Factor) / Volume Inoculated (mL)

For example, if ImageJ detects 184 colonies on a plate inoculated with 0.1 mL of a 10⁻⁴ dilution:

CFU/mL = (184 × 10⁴) / 0.1 mL = 1.84 × 10⁷ CFU/mL

According to FDA Bacteriological Analytical Manual (BAM) standards, countable plates should contain between 30 and 300 colonies (25 to 250 under ISO 7218) to ensure statistical accuracy and avoid growth suppression from overcrowding.

Clonogenic survival metrics:

Plating Efficiency (%) = (Colonies Counted / Cells Seeded) × 100%

Survival Fraction = Treated Plating Efficiency / Control Plating Efficiency

Troubleshooting ImageJ

Automated colony segmentation can encounter challenges arising from lighting variations, extreme crowding, or optical artifacts. The following table provides documented corrective actions:

Issue Encountered Root Cause Corrective Action
Watershed over-segmentation Internal texture, dimples, or colony pigmentation fluctuations create multiple local intensity maxima. Apply a mild Gaussian blur (Process → Filters → Gaussian Blur, radius 1.5 to 2.0 pixels) prior to thresholding, or run Process → Binary → Fill Holes.
Under-counting small colonies Threshold cutoff too high or minimum size filter set excessively high. Lower minimum size threshold in Analyze Particles (e.g., from 50 to 15 pixels). Test adaptive local thresholding (Image → Adjust → Auto Local Threshold) with Bernsen or Phansalkar algorithms.
Dish edge false positives Liquid meniscus, bevel reflections, or plastic dish walls form bright perimeter arcs. Inscribe circular ROI inside the meniscus and run Edit → Clear Outside. Set circularity filter in Analyze Particles to 0.40-1.00 to exclude crescent arcs.
Confluent colony lawn Inoculum exceeds countable density (over 300 CFU/plate), causing colonies to merge into solid sheets. Watershed cannot resolve confluent lawns. Count higher dilution plates per FDA BAM guidelines, or use ColonyArea plugin to measure total stained area percentage and optical density.
Java out of memory error Heap space exhausted when processing multi-image stacks or high-resolution camera RAW files. Increase memory allocation under Edit → Options → Memory and Threads to 75% of physical RAM. In batch macros, ensure images close via close(); after saving metrics.

Free alternatives to ImageJ

While ImageJ is the most widely cited open-source image analysis tool in biological research, specialized alternative packages exist for automated colony enumeration:

Software Tool Developer / Organization Primary Focus Key Strengths Limitations Compared to ImageJ
OpenCFU Quentin Geissmann / Imperial College London Dedicated microbial colony and circular object enumeration Fast recursive thresholding; automatic dish detection; filters dust via color and circularity; CLI support. Specialized exclusively for circular objects; lacks general bioimage manipulation and custom plugin architecture.
CellProfiler Broad Institute of MIT and Harvard High-throughput automated image analysis pipelines Modular multi-step pipelines; powerful object declumping; headless cluster execution; batch multi-well processing. Steeper learning curve; requires constructing formal multi-module project pipelines for simple single plates.
Ilastik EMBL Heidelberg Interactive machine learning image segmentation Random forest pixel classification learns subtle contrast differences from user brushstrokes; handles complex backgrounds. Higher computational demands; requires training annotations before running batch classification.
QuPath University of Edinburgh Whole-slide imaging and digital pathology Exceptional handling of gigapixel image pyramids; interactive colony and cell clustering; integrated StarDist deep learning. Tailored primarily for histopathology slides rather than standard microbial petri dishes.
NICE National Institute of Standards and Technology (NIST) Standardized automated colony counting for viral and bacterial assays Standardized thresholding algorithms calibrated against reference standards; reproducible multi-well grid support. Limited modern operating system updates; restricted user interface flexibility compared to Fiji ecosystem.

The data table below compares the architectural specifications, separation algorithms, and scripting environments across these bioimage analysis platforms.

Frequently asked questions

How do you count colonies automatically in ImageJ?

To count colonies automatically in ImageJ, open your plate photograph, convert it to 8-bit grayscale via Image → Type → 8-bit, and isolate the plate area using the circular selection tool followed by Edit → Clear Outside. Next, navigate to Image → Adjust → Threshold to segment colonies as binary foreground particles, run Process → Binary → Watershed to separate touching boundaries, and execute Analyze → Analyze Particles with size and circularity filters enabled. ImageJ outputs the total colony tally in a Summary window alongside individual colony measurements in a Results table.

How do you separate touching colonies in ImageJ?

Touching colonies are separated using the binary watershed transform located under Process → Binary → Watershed. The algorithm computes a Euclidean Distance Map from the background boundaries, locates Ultimate Eroded Points representing the center of each individual colony, and dilates them until touching edges intersect, drawing a 1-pixel separating line along the saddle points of touching clusters.

What size and circularity settings should be used to count colonies?

In the Analyze → Analyze Particles dialog, set the Size parameter to a minimum of 20 to 50 pixels (e.g., 20-Infinity) to filter out fine background agar precipitate, sensor noise, and dust particles. Set Circularity between 0.40 and 1.00 for standard microbial colonies, which excludes irregular elongated scratches, cotton fibers, and peripheral meniscus edge artifacts while capturing spherical and slightly oval colonies.

How do you count colonies manually with the Cell Counter plugin in ImageJ?

For plates with irregular or multi-species morphology, navigate to Plugins → Analyze → Cell Counter (or Plugins → Cell Counter in Fiji) and click Initialize. Select Type 1 and click each colony directly on the image to place a colored marker and update a real-time tally. You can assign different marker types to distinct colony phenotypes or contaminants, and export the resulting coordinate points and counts to CSV.

Can ImageJ calculate colony area percentage for clonogenic assays?

Yes. In standard Analyze Particles, checking “Summarize” outputs the total %Area covered by colonies within your selected region of interest. For densely stained clonogenic survival assays in 6-well to 24-well plates, researchers frequently use the specialized ColonyArea plugin (Plugins → ColonyArea → Colony measurer), which automatically corrects well illumination and calculates colony area percentage and integrated staining intensity.

How do you exclude the petri dish edge when counting colonies in ImageJ?

To exclude petri dish edges, select the Oval Selection tool from the toolbar, hold Shift to constrain it to a circle, and align it just inside the internal agar meniscus. Then select Edit → Clear Outside to replace all outer pixels with the background color. Additionally, setting a circularity threshold of 0.40 to 1.00 in Analyze Particles automatically filters out any crescent-shaped edge reflections that remain near the perimeter.

Sources

Data: Colony Counting and Bioimage Quantification Software Technical Parameters

Technical specification comparison of open-source bioimage analysis and colony counting platforms, detailing primary segmentation algorithms, touching colony separation methods, multi-channel capabilities, scripting interfaces, and execution environments compiled from peer-reviewed software publications and official documentation.

Colony Counting and Bioimage Quantification Software Technical Parameters
Software PlatformSoftware Version VerifiedLicense ModelSegmentation AlgorithmClustering SeparationMulti-Channel Color SupportScripting and AutomationRecommended Throughput
ImageJ / FijiImageJ 1.54f / Fiji 2.14.0Public Domain / BSD-2-ClauseGlobal and local intensity thresholding (Otsu, Yen, Triangle)Euclidean Distance Map (EDM) binary watershed transformRGB color thresholding, color deconvolution, and split channelsImageJ Macro (IJM), Jython, JavaScript, Groovy, BeanShell, JavaModerate throughput (scriptable batch processing)
CellProfilerCellProfiler 4.2.5BSD 3-ClauseModular probabilistic thresholding (Otsu, Minimum Cross-Entropy)Shape and intensity peak watershed (IdentifyPrimaryObjects)Native multi-channel fluorescence and brightfield pipeline supportPython 3 pipeline modules and headless CLI executionHigh throughput (automated multi-well plate batch runs)
OpenCFUOpenCFU 3.9.0GPL v3Recursive thresholding with bilateral filtering and color clusteringConvex hull geometry and circularity boundary optimizationNative RGB Hue/Saturation/Value (HSV) color thresholdingC++ command-line interface (CLI) with batch script executionHigh throughput (dedicated agar plate batch processing)
IlastikIlastik 1.4.0GPL v2Supervised Random Forest machine learning pixel classificationHysteresis thresholding and seed-based watershed on probability mapsArbitrary multi-spectral and multi-channel image volumesPython API, headless batch mode, and ImageJ bridge pluginModerate to high throughput (complex morphology classification)
QuPathQuPath 0.5.1GPL v3Intensity thresholding, cell detection, and StarDist deep learningConcave hull geometry splitting and watershed boundary assignmentMultiplexed whole-slide fluorescence and brightfield imagingGroovy scripting console and command-line batch runnerHigh throughput (whole-slide histopathology and colony arrays)

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about Count Colonies in ImageJ: Step-by-Step Guide

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →