I’m trying to design an algorithm for selecting photos which are monochrome (the one photographers call “black & white”) and have a single color toning such as sepia. (think as you’ve applied a solid color filter to a monochrome image) If I was after just monochrome only, all I need is to check the saturation which is easy (and I’m currently doing it), but it is unsuccessful at finding solid-color-toned monochrome photos. What could be an approach for that one?
I’m trying to design an algorithm for selecting photos which are monochrome (the one
Share
If an image is monochrome, either black and white or sepia, the colors corresponding to each lightness level should be nearly identical. Convert the image colorspace to one which contains a Luminance (Y) or Lightness component, such as YCbCr or HSL, and for each Y/L value look at the variance in the other two channels. If the values cluster together, you have a monochrome image.