Converting 32-bit Color Images to 8-bit Images in Vision Assistant

Updated Nov 19, 2020

Environment

Software

  • Vision Assistant
  • Vision Development Module

I want to use some IMAQ Vision processing functions on a color image, but they require a grayscale image.

How do I convert the color image to an 8-bit grayscale image in Vision Assistant?

To extract a color plane from an image in Vision Assistant, follow these steps:
  1. Add the Color Plane Extraction step from the list of Color Processing Functions.
  2. In the Setup window, choose the desired color plane.  The Processing Window will display a preview of the resulting grayscale image.
  3. Click OK.

Additional Information

A 32-bit color image is encoded in memory as either an RGB (Red, Green, Blue) or an HSL (Hue, Saturation, Luminance) image.  RGB images store color information using 8 bits each for the red, green, and blue planes. HSL images store color information using 8 bits each for hue, saturation, and luminance.  In both cases, the alpha plane is not used.

Figure 1. RGB Format


Figure 2. HSL Format
To convert the color image to an 8-bit grayscale image, you can simply extract the desired 8-bit plane from the color image.