I’m wondering if there are any algorithms out there written in Java currently for determining if an image has a low range of different pixel colours contained within it.
I’m trying to detect placeholder images (that typically consist of high percentages of single colours (typically white and grey pixels) as opposed to full colour photos (that consist of a plethora of multiple colours).
If nothing exists, I’ll write something myself (was thinking about sampling an arbitrary pixels in random positions across the image or averaging out all pixel colours contained across the image) and then determining quantities of the different colours I find. There may be a trade off between speed and accuracy depending on the methodology used.
Any advice / pointers / reading material appreciated.
A way to do it would be:
You can also use the Java Advanced Imaging(JAI) since it provides a Histogram class:
}