I have some images in which I expect to have some red, green, blue, or yellow areas. Like this image:
Now, I'd like to get 4 binary images, representing each of the 4 colors. What I'd like to have is a process that decides, pixel by pixel, which of the 4 colors is closest (or black). I know we can do something like this to split the RGB channels:
Binarize[#, 0.25] & /@ ColorSeparate[myImage]
My primary question is, how could I add the yellow color (or any other color) to the color separation? A related question, does
ColorSeparate ensures that no two binary images share a white (foreground) pixel? By eye I don't see much overlap, but I imagine if two colors are close together they might be assigned to two binary images(?), say, orange & yellow. If so, how to ensure that each foreground pixel is only present in exactly one of the binary images? I was thinking on using something similar to what is in this question, but it seems that a distance from a color would not work with similar colors (some pixels would be assigned to two binary images).