How to convert a color image to grayscale

January 9, 2018
January 9, 2018

Sometimes an undemosaiced Bayer raw image gets improperly saved into a BMP or TIFF format that includes color channels that are all equal. In this case, Imatest will recognize the image as color, and not give you the monochrome read options that allow you to perform demosaicing or analyze the image as a Bayer raw.

Here are a variety of ways to convert a color image to grayscale:

Imagemagick command line utility

$ convert -type Grayscale rawcolor.bmp mono.bmp

GIMP / Photoshop

Image -> Mode -> Grayscale

 

ImageJ

From Image -> Tyoe -> Select the desired output bit depth

Irfanview

Ctrl-G or from the image menu select Convert to Grayscale

MATLAB

img = imread('rawcolor.bmp');
r = img(:, :, 1);
imwrite(r, 'mono.bmp');

 

One comment on “How to convert a color image to grayscale

  1. I will be adding a “Save as monochrome” function to the Imatest Image Processing module. We should have this function built in.

Leave a Reply

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

*
*
Website