Color Measurement Using ImageJ Software

Compiler name:Ahmad Ehtiati (PhD in Food Technology)
3 min

ImageJ Software

ImageJ is an open-source software (Introduction to Image Processing Software ImageJ) that, in addition to its basic tools, offers various plugins for performing algorithms and different image processing methods (Application of Image Processing in the Food Industry). To install the software and download its plugins, you need to visit the official website.

Color Measurement Based on Image Processing

In many food industry studies and quality control units, color measurement is a test used to understand the color characteristics of a product. Today, equipment is available that measures the product’s color under standard conditions. However, in some cases, access to such equipment may not be possible. In these situations, color measurement in digital images is a quick and accessible method. It is important to note that proper imaging techniques, such as lighting and using standard color patches, will yield more accurate results.

Color Spaces of Digital Images

Each image contains a set of numbers representing the pixel information. Each pixel is a square-shaped point in the image, and the collection of these points forms the complete image. An image file includes pixel coordinates and the color information for each pixel. The color information of an image is defined by its color space, which, for example, in digital devices, could be the RGB color space. In food product color representation, the CIELAB color space is commonly used. In this color space, three components (L, a, and b) are used to describe parameters: L for lightness, a for redness or greenness, and b for yellowness or blueness. The L component ranges from 0 to 100%, with 100 representing the highest lightness. The a component ranges from -128 to +127, where positive values indicate red, and negative values indicate green. Similarly, the b component ranges from -128 to +127, where positive values indicate yellow and negative values indicate blue.

Determining Lab Color Space Parameters of an Image

To determine the Lab color space information of an image, the image’s color space must first be converted, and then the channels are separated. Finally, pixel intensity within the desired range is measured, and the average and standard deviation of the pixels are calculated. To perform the color space conversion, download the “Color Space Converter” plugin from the software’s website and install it using the “Install” option from the “Plugins” menu.

Color Measurement Using ImageJ Software

Changing the Color Space

Once the image is opened in ImageJ (through the “File” menu or by dragging the file into the program), it will be ready for color space conversion. Go to the “Plugins” menu and select the “Color Space Converter” option. In the window that appears, the following options should be set:

  • The “From ColorSpace” option should be set to the current image’s color space, which is likely RGB.
  • The “To ColorSpace” option should be set to “Lab color space”.
  • The “White Point” option should be adjusted according to the lighting conditions during image capture.
  • The “Separate Images” option should be enabled.

Upon confirming the window, the image will be split into three separate color channels, with the channel names displayed in the title of each image.

Measurement

For measurement, after selecting the window of each color channel, choose “Measure” from the “Analyze” menu. To ensure the desired statistical options appear in the results table, select the desired options from the “Results” menu under “Set Measurements.” For example, “Mean Grey Value”, “Standard Deviation,” and “Display Label” could be preliminary options.

Color Measurement in Images with Backgrounds

To measure color in images with backgrounds, it is necessary to first edit the image in software like PhotoShop to select and remove the background from the main layer, then save it in PNG format. During the measurement phase, use the Wand tool to select the target area, save it in the ROI Manager, and then perform the measurement within the selected range in the image channel.

For more information, refer to the articles “Shape Description Using ImageJ Software” and “Introduction to Image Processing Software ImageJ”.

:)

Leave a Reply

Your email address will not be published. Required fields are marked *

Set your categories menu in Header builder -> Mobile -> Mobile menu element -> Show/Hide -> Choose menu
Create your first navigation menu here
Shopping cart
Start typing to see posts you are looking for.