# Watershed in ImageJ: separate touching particles (and when not to)

> Split touching nuclei and nanoparticles with Process › Binary › Watershed in ImageJ, with before and after counts, and why it cuts nanorods to pieces.

Published 2026-11-06 by LabCanvas team. https://www.labcanvas.com/blog/watershed-touching-particles

![ImageJ 1.54f masks of synthetic TEM gold nanoparticles without and with Process › Binary › Watershed, each particle in its own colour: touching particles merged into 74 objects before, split into 136 after](https://www.labcanvas.com/blog/imagej/watershed-touching-particles-tem.webp)

To separate touching particles in ImageJ, threshold the image, make a binary mask (**Process › Binary › Convert to Mask**), and run **Process › Binary › Watershed**: it cuts a one-pixel line through each narrow neck between round objects, so **Analyze › Analyze Particles** counts them one by one. On our TEM nanoparticle sample the count went from 74 to 136 and the mean Feret diameter from 21.71 to 13.78 nm. Do not use it on long or branched objects: it cut 36 nanorods into 271 pieces.

This guide shows what Watershed does, step by step, on three synthetic sample images, with the counts before and after.

## What does Watershed do in ImageJ?

**Process › Binary › Watershed** is a binary watershed: it works on a black-and-white mask, not on the grey image. It runs three steps you can also run on their own from the same menu:

1. **Distance Map** (the Euclidean distance map, EDM): each object pixel gets the distance to the nearest background pixel. The centre of a round particle is brightest; two particles that touch look like two hills joined by a low saddle.
2. **Ultimate Points**: the top of each hill, one point per round object. Its value is the distance to the edge, the radius of the largest circle that fits in the object there.
3. **Watershed**: the hills are flooded from their tops downwards, and where two floods meet a one-pixel line of background is drawn. That line cuts the neck between touching particles.

![Four panels from ImageJ: a binary mask of touching nanoparticles, its distance map, its ultimate points in red, and the watershed cut lines in red](https://www.labcanvas.com/blog/imagej/watershed-touching-particles-steps.webp "ImageJ 1.54f on a 320 × 320 pixel crop of the TEM nanoparticle mask: the mask, Process › Binary › Distance Map, Ultimate Points with one peak per particle, and Watershed, whose one-pixel cuts are thickened in red here so you can see them.")

Because a cut happens wherever two peaks meet, the method assumes **one peak per object**: round or slightly oval particles that touch at a neck narrower than their width. Everything that follows comes from that one assumption.

## How do I split touching particles? (step by step)

These commands are part of ImageJ 1.x, the same in plain ImageJ and in Fiji.

1. **Threshold the image**: **Image › Adjust › Threshold…**, a method that gives clean objects (see [the threshold methods compared](https://www.labcanvas.com/blog/imagej-threshold-methods)), **Dark background** ticked for bright objects. Click **Apply** or run **Process › Binary › Convert to Mask**.
2. **Check the mask's colours**: **Process › Binary › Options…** with **Black background** ticked means white objects on black. Watershed splits the foreground, so the objects must be the foreground.
3. **Fill holes**: **Process › Binary › Fill Holes**. A particle with a hole in its mask has a ring of peaks and gets cut like a pie.
4. **Process › Binary › Watershed**. It needs no settings.
5. **Count**: **Analyze › Analyze Particles…** with a minimum size, **Exclude on edges** if the particles cut by the frame must not count, **Display results** and **Summarize**.
6. **Look at the outlines** (Show: **Outlines** or **Overlay**) before you trust the count. Every cut should sit at a neck.

![ImageJ Binary Options dialog with Black background, EDM output and Do options numbered](https://www.labcanvas.com/blog/imagej/watershed-touching-particles-binary-options.webp "Process › Binary › Options: Black background sets which colour is the object; EDM output chooses whether Distance Map overwrites the mask or makes a new 8-, 16- or 32-bit image; Do runs Erode, Dilate, Open, Close, Outline, Fill Holes or Skeletonize, with a preview.")

In a macro, the same chain is:

```
setAutoThreshold("Otsu dark");
setOption("BlackBackground", true);
run("Convert to Mask");
run("Fill Holes");
run("Watershed");
run("Analyze Particles...", "size=7-Infinity display exclude summarize");
```

## Before and after: nanoparticles and nuclei

**TEM gold nanoparticles** (synthetic sample, 1024 × 1024 pixels at 0.25 nm per pixel, dark particles on a light film, many in clumps). Default threshold, Fill Holes, then Analyze Particles from 20 nm², excluding particles cut by the frame. Each colour is one object in ImageJ's mask:

![TEM nanoparticle masks from ImageJ without and with Watershed, each particle in its own colour](https://www.labcanvas.com/blog/imagej/watershed-touching-particles-tem.webp "ImageJ 1.54f on the TEM gold sample: without Watershed, 74 objects with a mean Feret diameter of 21.71 ± 9.74 nm because clumps count as one; with Watershed, 136 particles of 13.78 ± 1.59 nm.")

| TEM sample | Count | Mean area | Feret diameter (mean ± SD) | Aspect ratio |
|---|---|---|---|---|
| Without Watershed | 74 | 237.77 nm² | 21.71 ± 9.74 nm | 1.56 |
| With Watershed | 136 | 133.85 nm² | 13.78 ± 1.59 nm | 1.06 |

The size distribution tells you the split worked: the standard deviation drops from 9.74 to 1.59 nm, and the mean aspect ratio from 1.56 to 1.06, as it should for round particles. Without the watershed you would report particles nearly 60% too large, with a spread six times too wide.

**Nuclei** (synthetic nuclei sample, 0.325 µm per pixel, Otsu threshold, from 7 µm²). The nuclei are mostly apart, so the watershed has little to do: 69 objects before, 70 after, the one difference a touching pair at the top left. The mean area goes from 41.00 to 40.39 µm².

![Nuclei masks from ImageJ without and with Watershed, each object coloured](https://www.labcanvas.com/blog/imagej/watershed-touching-particles-nuclei.webp "ImageJ 1.54f on the nuclei sample: 69 objects without Watershed, 70 with it; the touching pair at the top left is the only object it splits.")

That small change is typical of a sparse field and is still worth having: one merged pair is one wrong area in your table. On a dense field of nuclei the difference is large.

## When not to use Watershed: the nanorod example

The same command on the synthetic SEM nanorod sample (2.5 nm per pixel, bright rods on a dark substrate, Default threshold, from 1,000 nm², excluding edges) gives a very different result:

![Nanorod masks from ImageJ with Watershed, rods cut into many pieces, and without it, each rod whole](https://www.labcanvas.com/blog/imagej/watershed-touching-particles-nanorods.webp "ImageJ 1.54f on the SEM nanorod sample: Watershed cuts the 36 rods into 271 pieces of 87.5 nm mean length and aspect ratio 1.8. Without it, 36 rods, 496.7 nm long on average with aspect ratio 11.5, as they should be.")

| SEM nanorods | Count | Feret length (mean ± SD) | MinFeret width | Aspect ratio |
|---|---|---|---|---|
| With Watershed (wrong) | 271 | 87.52 ± 34.16 nm | 46.72 nm | 1.81 |
| Without Watershed (right) | 36 | 496.72 ± 154.55 nm | 53.47 nm | 11.51 |

A rod's distance map is a long ridge, not a hill, and noise along its edges puts a small peak every rod-width or so. Each peak becomes a seed, so the rod is sliced into near-square pieces: the "particles" come out with an aspect ratio of 1.8 and a length about a sixth of the truth. Nothing in the Summary warns you; only the outlines do.

The same happens to any object that is not convex and roughly round: elongated bacteria, dividing cells, neurons, fibres, platelets seen edge-on, irregular grains and flakes. Watershed also splits a single oval nucleus in two when it has a pinched waist.

### What to do instead

- **Rods, wires, fibres**: leave Watershed off. If rods cross, measure the crossing ones by hand or with a line, or exclude them with a solidity or circularity range in Analyze Particles; see [nanowire length and aspect ratio from SEM](https://www.labcanvas.com/blog/nanowire-length-aspect-ratio-sem).
- **Over-split round objects**: smooth the mask first (a Gaussian blur of 1–2 pixels before thresholding, or **Process › Binary › Open**), which removes the small bumps that create extra peaks.
- **Under-split clumps**: a better threshold usually helps more than anything else; for strongly overlapping objects, Watershed cannot find a neck that is not there.
- **Cells with a nucleus each**: use the nuclei as seeds. **Process › Find Maxima…** with **Output type: Segmented Particles** in ImageJ 1.x floods the grey image from the maxima you see in the preview; Fiji's MorphoLibJ plugin has a full marker-controlled watershed.
- **Crowded or irregular cells**: deep-learning segmentation (StarDist for nuclei, Cellpose for cells, both available for Fiji) separates them far better than any binary watershed.

## How do I check whether Watershed over-split or under-split?

- **Show the outlines.** Analyze Particles with Show: **Outlines** or **Overlay**, and zoom in. Every cut line should run across a neck.
- **Look at the aspect ratio and the size spread.** Set **Analyze › Set Measurements** to include **Shape descriptors** and **Feret's diameter**. Merged clumps raise the aspect ratio and the SD of the size; over-split rods drop the aspect ratio towards 1 and the size to the rod width.
- **Compare the count with and without.** A change of a few percent on a sparse field is normal. A count that multiplies several times means the objects were not round.

## Pitfalls

- **The mask is inverted.** With Black background set the other way from your mask, Watershed splits the background. Check that the objects are the foreground colour.
- **Holes in the mask.** Fill holes before the watershed, or hollow particles are cut into wedges.
- **Watershed on the grey image.** Process › Binary › Watershed works on a binary mask (0 and 255). Threshold and convert first; on an ordinary grey image it stops with a message asking for an 8-bit binary image.
- **Cutting what is not touching.** Rods, oval nuclei with a waist and irregular grains get cut. Look before you count.
- **Measuring the wrong image.** The watershed lines remove a pixel from each particle's edge where it was cut. For intensities, measure the original image through the particle outlines (Analyze Particles with Add to Manager, then Measure on the original) rather than the mask.

## Reporting it

> Touching particles were separated with the binary watershed of [ImageJ 1.54f] (Process › Binary › Watershed) after [Default] thresholding and hole filling; particles of at least [20] nm² not touching the image border were measured with Analyze Particles ([136] particles, Feret diameter [13.78 ± 1.59] nm, mean ± SD).

Say that you used the watershed: a reader who repeats your analysis without it gets a different count. For elongated objects, say that you did not, and why.

## An easier way: split touching particles in LabCanvas

[LabCanvas Image Analysis](https://www.labcanvas.com/analysis.html) has the same watershed in the browser, with nothing to install, as a tick box you can switch on and off while you watch the outlines and the count change.

1. Open your image (or the nuclei sample on the start screen) and go to **Count** › **Count particles**.
2. Choose the threshold method and whether the objects are bright or dark.
3. Tick **Fill holes**, **Separate touching objects (watershed)** and **Exclude particles on the edges**, and set the size and circularity ranges.
4. Click **Count**. **Process › Binary** has **Watershed**, **Distance map** and **Ultimate points** (with their radius in a table) as separate steps on a mask, if you want to see each one.

:::grid
![Nanoparticle size from TEM in LabCanvas Image Analysis](https://www.labcanvas.com/analysis-examples/em-tem-np.webp "Nanoparticle size from TEM: 136 gold nanoparticles counted, touching ones split by the watershed: Feret diameter 13.77 ± 1.589 nm mean ± SD.")
![Nanorod length and width SEM in LabCanvas Image Analysis](https://www.labcanvas.com/analysis-examples/em-sem-rods.webp "Nanorod length and width SEM: 36 nanorods those cut by the frame left out: length 496.7 ± 154.6 nm Feret, width 53.47 ± 10.17 nm MinFeret, aspect ratio 11.51 ± 3.885.")
:::

On the same synthetic images, LabCanvas gives ImageJ's numbers: 136 particles of 13.77 ± 1.589 nm (ImageJ: 136 particles, 13.78 ± 1.59 nm) with the watershed on, and, with it left off, 36 nanorods of 496.7 nm (ImageJ: 36 rods, 496.72 nm).

Why it is a good choice for touching particles:

- **See the split before you commit**: the outlines and the count update as you tick the watershed on and off, which is the over-split check above done live.
- **ImageJ's names and measurements**, Feret diameter and shape descriptors included.
- **Results straight into Graphs** for the size histogram with statistics, and a **Methods** line that states whether the watershed was on.
- **Free with a LabCanvas account**, and every measurement is checked in [more than 4,000 automated tests](https://www.labcanvas.com/image-analysis-validation).

When neither a threshold nor the watershed separates your objects, the **Pixel classifier** in the Count tab is the next step; for crowded cells, StarDist or Cellpose in Fiji or Python is still the better tool. [Open Image Analysis](https://www.labcanvas.com/analysis.html), or read the [complete guide](https://www.labcanvas.com/blog/image-analysis-complete-guide).

ImageJ and Fiji are independent open-source projects; LabCanvas is not affiliated with them.

## References

- Schneider CA, Rasband WS, Eliceiri KW (2012). NIH Image to ImageJ: 25 years of image analysis. *Nature Methods* 9, 671–675. [doi:10.1038/nmeth.2089](https://doi.org/10.1038/nmeth.2089)

## Frequently asked questions

### How do I separate touching particles in ImageJ?

Make a binary mask (Image › Adjust › Threshold, then Apply or Process › Binary › Convert to Mask), fill holes if needed, then run Process › Binary › Watershed. It draws one-pixel lines through the narrow necks between round objects, so Analyze Particles counts them separately. On our TEM nanoparticle sample the count went from 74 to 136.

### Why does Watershed cut my cells or rods into pieces?

ImageJ's Watershed assumes every object is roughly round: it puts one seed at each local maximum of the distance map and cuts between seeds. A long rod or an irregular cell has many maxima along its length, so it is cut every few widths. On our SEM nanorod sample, 36 rods became 271 pieces. Do not use it on elongated or branched objects.

### Why does Watershed do nothing in ImageJ?

It needs an 8-bit binary mask with the objects in the foreground colour. If the mask is inverted (Process › Binary › Options › Black background does not match your mask), it splits the background instead of the objects, or nothing at all. It also cannot split objects that overlap so much that there is no neck between them.

### What is the difference between Distance Map, Ultimate Points and Watershed?

Distance Map replaces each object pixel with its distance to the nearest background pixel. Ultimate Points keeps only the peaks of that map, one per round object, with the distance (its radius) as the value. Watershed grows each peak back out over the distance map and draws a line where two of them meet, which is where touching objects get cut.

### Is watershed in ImageJ the same as marker-controlled watershed?

No. Process › Binary › Watershed is a binary watershed on the distance map that chooses its own seeds. Marker-controlled watershed, where you supply the seeds (for example nuclei for whole cells) and flood an intensity image, is in Fiji through the MorphoLibJ plugin, or can be done with Find Maxima in ImageJ 1.x.

## Related links

- [How to count cells in ImageJ](https://www.labcanvas.com/blog/count-cells-imagej): Threshold, watershed and Analyze Particles from the start
- [ImageJ threshold methods compared](https://www.labcanvas.com/blog/imagej-threshold-methods): Make the mask the watershed works on
- [Nanoparticle size distribution from TEM](https://www.labcanvas.com/blog/nanoparticle-size-distribution-tem): From the split particles to a histogram
- [Nanowire length and aspect ratio from SEM](https://www.labcanvas.com/blog/nanowire-length-aspect-ratio-sem): Measuring rods without cutting them
- [Feret diameter and circularity](https://www.labcanvas.com/blog/feret-diameter-circularity): The shape numbers that show a bad split
- [Image Analysis: the complete guide](https://www.labcanvas.com/blog/image-analysis-complete-guide): Every tool and setting in the app, with examples
