Graphing area from an image series using ImageJ: a simple method
Sally P Leys, Vanessa R Ho
Abstract
This protocol provides a quick way to quantify change in area of an object in a large series of images, by pixel contrast. It's equivalent to rootpainter, except much simpler, but it does rely on good contrast of light and dark in the region you wish to measure.
Others have used ImageJ for this too, but the method and workflow we provide has been tested successfully by many students and therefore offers a more consistent, standardized process.
Before start
Make sure you have ImageJ downloaded, available here: https://imagej.net/software/fiji/
Steps
Create a workflow (macro) in ImageJ with the following steps: This will be run on all your images.
- Open ImageJ
- Opening an image,
- Selecting Plugin>Macro>Record, which opens up a ‘recorder’ window.
Note
Once you have the recorder window open it will automatically record your actions from this point onward
Recording the macro for image processing:
- Set image type to 8-bit grayscale
- Select the rectangular selection tool and draw a rectangle over the image to create a ROI,
- Crop the image to that region >Image>Crop,
- Threshold the image >Image>Adjust>Threshold>Auto>Set>OK,
- Measure the area fraction, >Analyze>Set Measurements>, check the Area Fraction box (no other measure is needed), >Analyze>Measure. This action sends the measurement to a results window.
- Save the results to a folder by choosing >File>Save as>[choose your folder and type the file name].
- Stop the macro recording in the ‘recorder’ window by clicking >Create.
A Macro.ijm window opens with the macro, click >File>Save as>[choose a
folder and file name for the macro].
Close the image and result window now.

Run the macro on a set of images:
- In the main ImageJ toolbar choose >Process>Batch>Macro, to open the batch process window.
- Select the folder which contains the image set to be analysed, and the folder where the data and the processed images will be placed.
- Copy and paste the macro.ijm file from above into the window, and click >Process.
The image set will be analysed and the area fraction for each image will be calculated and placed in
a .csv file, which can be opened for graphing or further analysis in Excel or other programs
