Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What algorithm does Photoshop use to desaturate an image?

I have been trying to figure out what kind of mathematical algorithm that programs like Photoshop use when they desaturate each pixel of an image. By desaturate, I mean turning a colored image into a greyscale image and still maintaining the colorspace. I am still talking about an RGB image but one that has just been desaturated in color and is now black and white.

Does anyone know what kind of algorithm is used?

like image 466
Pladnius Brooks Avatar asked Feb 16 '12 23:02

Pladnius Brooks


1 Answers

Desaturating is pretty simple. The usual is something like G*.59+R*.3+B*.11

Photoshop also has a B&W conversion tool that (basically) lets you select the factor for each. For example, you can get the effect of a red filter by increasing the percentage of red, and decreasing the green and blue to match.

like image 112
Jerry Coffin Avatar answered Oct 14 '22 07:10

Jerry Coffin