I have mostly black and white image, with some parts in color (let's say it's yellow and green). I would like to find out those colors.
For that, I suppose I might convert image to black & white, and then compare b & w image with original one to find the difference. But I'm not quite sure which algorithm I should use to do that.
Something like that in pseudocode:
image = image_from_file('image.jpg')
bw_image = image.convert_to_bw
diff_image = (bw_image - image)
# Build histogram w/o black and white parts, only color ones
diff_image.histogram
I'm primary focused on libvips to do that, but I just need an advice of how to do that in general, then I'll be able to code that.
I would also appreciate if you know any other way to do what I described above.