I'd like to quantify the number of pixels in an image based on their color, ignoring black background pixels. The heights are predefined and organized by color.
Since the colors are set, it shouldn't be too difficult to count the pixels. However, doing this with RGB tuples is difficult. Can the RGB image input be converted to hex so that green RGB values of 0, 255, 1 = hex #00ff01, and then all the pixels of that hex value added up?
Basically I'm trying to see how these images change as I alter parameters that generate their output. Thought a good "scientific" way would be to count the pixels to see if more are green, less are yellow, orange, and red, than just visually looking through.
Thanks.