Is there an efficient way to determine if an image is in greyscale or in color? By efficient I don’t mean reading all the pixels of the image and looking for every single RGB value then.
For example, in Python there is a function inside the Imaging library called ‘getcolors’ that returns a hash of pairs { (R G B) -> counter } for the whole image and I just have to iterate over that hash looking for only one entry in color.
UPDATE:
For future readers of this post: I implemented a solution reading pixel by pixel the image (as @npinti suggested on his link) and it seems to be fast enough for me (you should take your time implementing it, won’t take you more than 10 minutes). It seems the Python implementation of the pixel by pixel way is really bad (inneficient and slow).