Written and maintained by CASRAI Editorial Board
Last updated
To measure leaf area in ImageJ, calibrate the image first (Analyze▷Set Scale…), convert it to a thresholded 8-bit image, then run Analyze▷Analyze Particles… with Summarize checked. The same Set Scale step also underlies every other length measurement and scale bar in ImageJ, so this guide covers all of them in one place: how to measure a length, how to add a scale bar, how to build a calibration image, and how to read the area numbers that come out.
What it is used for in research
ImageJ is public domain software for processing and analyzing scientific images. A photograph or scan is made of pixels, and ImageJ reports measurements in pixels until the image is told how long a pixel is. Spatial calibration is what turns a pixel count into millimetres or micrometres, and it is the step most often missed when a leaf area or length comes out as an unexplained large number.
- Leaf area: threshold the leaf against its background and sum the area of the thresholded particles.
- Length: draw a straight line over a feature and measure it (petiole, root, scratch, crack).
- Scale bars: add a labelled bar to a figure so readers can judge size.
- Size distributions: the same threshold and Analyze Particles route returns one row per particle, which is how particle and grain sizes are measured from thresholded images.
For the same calibration idea applied to microscope images, see microscope calibration with a stage micrometer. For intensity rather than size measurements, see western blot densitometry in ImageJ.
Install or access
The official ImageJ download page (imagej.net/ij/download) offers a platform-independent ZIP archive for computers with Java already installed, and bundled installers for Windows, macOS and Linux. Fiji, a distribution of ImageJ that bundles many plugins, is described on imagej.net/software/fiji. The menu commands below are the same in both. If you are deciding between them, see Fiji vs. ImageJ.
Step-by-step: calibrate, measure length, add a scale bar, measure leaf area
1. Put a known length in the image (the calibration image)
Spatial calibration needs one distance in the image whose real length you know. For leaves, that means photographing or scanning the leaf together with a ruler or an object of known size, in the same frame and at the same camera distance as the leaf. An image of a ruler taken at a different distance, or cropped from a different shot, calibrates a different pixel size and gives wrong areas. Keep the file at its original resolution until after you have set the scale.
2. Set the scale (this also answers “how to measure length in ImageJ”)
- Open the image (File▷Open).
- Choose the Straight Line selection tool and draw a line exactly along the known distance, such as 10 cm on the ruler.
- Choose Analyze▷Set Scale…. The Distance in Pixels field is filled in automatically from the length of your line.
- Enter the Known Distance and the Unit of length, then click OK. The ImageJ guide notes that “um” or “micron” can define micrometre.
Leave Pixel Aspect Ratio at 1.0 for ordinary square pixels; a value other than 1.0 is for images with different horizontal and vertical spatial scales. Tick Global only if every image you open in the current session shares this scale (for example, a fixed copy stand with a fixed camera): when Global is checked, the scale is used for all images opened during the session. To undo a scale, open the dialog again and click Remove Scale, which resets Distance in Pixels and Known Distance to zero and the unit to pixel.
Check it: draw a second line over a different known length (another ruler interval) and press Analyze▷Measure… (shortcut m). If the reported length is not close to the true value, the first line or the entered distance was wrong; redo the scale.
3. Measure a length
With the scale set, draw a straight line over the feature and run Analyze▷Measure…. According to the ImageJ guide, for linear selections the length and, for straight lines, the angle are calculated and shown in the Results table. Segmented and Freehand line tools work the same way for curved features such as a root or a curved leaf edge. Use Analyze▷Set Measurements… to choose what Measure records.
4. Add a scale bar
- Make sure the image is calibrated (step 2).
- Choose Analyze▷Tools▷Scale Bar….
- Set Width, which is the length of the bar in calibrated units, plus Height in pixels, Font Size, Color and Location. Tick Hide Text if you want the bar without its label.
- Tick Overlay to create the bar as a non-destructive image overlay. If Overlay is unchecked, the scale bar is drawn invasively into the pixels.
If a selection is active, the bar is initially drawn at the selection. Save a copy of the image if you choose the invasive option.
5. Measure leaf area
- Calibrate the image (step 2). Optionally crop to the leaf with a rectangle selection and Image▷Crop, but do this after setting the scale.
- Convert to grayscale with Image▷Type▷8-bit.
- Open Image▷Adjust▷Threshold… (shortcut T) and adjust the levels until the leaf, and only the leaf, is highlighted. Click Apply, or leave the threshold set for the next steps.
- Open Analyze▷Set Measurements…, tick Area, and tick Limit to threshold so that only thresholded pixels are included in the measurement.
- Open Analyze▷Analyze Particles…. Set a Size range that excludes dust and specks. Tick Display results, Summarize and, if you want a visual check, choose Show: Outlines.
- Click OK. Each particle gets a row in the Results table, and the Summary window gives the count and the total area.
Two options change the leaf’s area. Include Holes controls whether interior holes are counted as part of a particle: when it is checked, ImageJ traces each particle by its outer edge and interior holes are included; when it is cleared, interior holes are excluded. Exclude on Edges ignores particles touching the image edge, so a leaf that runs off the frame will be dropped entirely rather than partly measured.
Output and how to read it
| Where | What you see | How to read it |
|---|---|---|
| Results table (one row per particle) | Area, plus anything ticked in Set Measurements | Area is in calibrated square units only if Set Scale was used; otherwise it is in square pixels. |
| Summary window (from Summarize) | Particle count, total area, average particle size, area fraction and the mean of the other chosen parameters | For a single leaf, total area is your leaf area. For several leaves in one image, use the per-particle rows to get each leaf. |
| Outlines (Show: Outlines) | A drawing of the particles counted | Compare against the original: missing outlines point to a threshold or Size filter problem. |
Limit to threshold matters if you run Analyze▷Measure on a selection instead of Analyze Particles: with it ticked, only the highlighted pixels count. With a rectangle drawn around the whole leaf and Limit to threshold off, Area is the area of the rectangle, not the leaf.
Troubleshooting
- Area is a huge number, or the unit column says pixels: no scale was set on this image. Run Set Scale, then re-measure. If the scale seems to vanish, check whether you opened a new image without Global ticked.
- Area is off by a consistent factor: the known distance or the line was wrong. Redo step 2 and run the second-line check.
- Debris is counted as extra particles: raise the lower limit of the Size range in Analyze Particles. Particles outside the range are ignored.
- The leaf is not counted or is only partly counted: it touches the image edge with Exclude on Edges ticked, or the threshold does not cover the whole leaf.
- Holes or veins counted differently than expected: toggle Include Holes and compare the outlines.
- Ellipse or major and minor axis values are missing: the ImageJ guide says these cannot be calculated if Pixel Aspect Ratio in the Set Scale dialog is not 1.0.
Free alternatives
| Tool | What the project says about it |
|---|---|
| ImageJ | Public domain software for processing and analyzing scientific images, with many derivatives and variants. |
| Fiji | A “batteries-included” distribution of ImageJ2 that bundles plugins for scientific image analysis; released as open source under the GNU General Public License; also includes the original ImageJ. |
| ImageJ2 | Named by the ImageJ project as a derivative of ImageJ; Fiji is built on it. |
For a detailed comparison of the first two, see Fiji vs. ImageJ. Fiji’s plugin set is also used for colocalization analysis.
FAQ
How do I measure length in ImageJ?
Set the scale from a known distance (Analyze▷Set Scale…), draw a straight line over the feature with the Straight Line tool, and run Analyze▷Measure… (m). The Results table reports the length in your calibrated unit.
How do I add a scale bar in ImageJ?
Calibrate the image, then use Analyze▷Tools▷Scale Bar…. Width is entered in calibrated units, and ticking Overlay keeps the bar as a non-destructive overlay.
What is a calibration image for ImageJ?
An image, or part of one, that contains an object of known size, such as a ruler, photographed or scanned under the same conditions as your samples. You draw a line along the known length and enter it in Set Scale. Photographs taken at a different distance need their own calibration.
Can I use the same method for grain size?
The measurement route is the same for any thresholded objects: set the scale, threshold, then run Analyze Particles with a Size range. What counts as a grain, and any reporting standard for grain size, is outside what the ImageJ documentation defines.
Does the scale carry over to the next image?
Only if Global was ticked in the Set Scale dialog, in which case it applies to all images opened during the current session.
Sources
- ImageJ User Guide, Analyze menu (Set Scale, Set Measurements, Analyze Particles, Tools▷Scale Bar): imagej.net/ij/docs/guide/146-30.html, checked 2026-10-29.
- ImageJ documentation, Analyze menu: imagej.net/ij/docs/menus/analyze.html, checked 2026-10-29.
- ImageJ download page: imagej.net/ij/download.html, checked 2026-10-29.
- ImageJ and Fiji software pages: imagej.net/software/imagej and imagej.net/software/fiji, checked 2026-10-29.








