SOD C/C++ API Reference - Image Processing


void sod_grayscale_image_3c(sod_img input);


Convert a given image colorspace to the gray color model. A grayscale (or graylevel) image is simply one in which the only colors are shades of gray. Grayscale images are very common & entirely sufficient for many tasks such as face detection and so there is no need to use more complicated and harder-to-process color images. A typical input image should look like the following after processing:

Input Picture

Nature before processing

After Processing via sod_grayscale_image_3c()

Nature after processing


sod_img    input

The input image to be processed. This function is a no-op if the input image is a single channel (i.e. already grayscaled). The image can be loaded from disk using sod_img_load_from_file(), from memory (i.e. network socket) via sod_img_load_from_mem() or dynamically created via sod_make_image().

Return Value

None. The colorspace conversion takes in place unlike sod_grayscale_image() which return the result of the graysclae color conversion in a new sod_img instance.


Checkout the introduction course, the C/C++ samples on the download page or refer to the SOD Github Repository.

See also