Calculate percentage of colors in image

Hi there! I’m trying to find a working and accurate way to calculate how much of specific colors are in a picture. Be it percents or just numbers. At this point I can’t use photoshop but maybe there’s other ways avaiable that you know of? Thanks in advance. BTW, geotests dot net is not accurate enough

What is geotests?

Acrobat can read colour separations.

will try acrobat, even though adobe products don’t seem to work on my machine

I think you need to better describe what you are wanting to do with the color. It doesn’t sound like you are looking for color seps. Or are you looking for ink percentages, not color percentages?

Hi!

For example, I’ve got an image with a red circle and a green one. The red circle is bigger. I want the software to tell me that there’s more red in the picture than there’s green. Hope that explains it better

thanks in advance

Yes it does read the separations but I can’t figure out why it gives zero percent to all the colours. I need to know what color dominates in the picture

In a 16-bit color image, 65,536 colors are possible. In a 3000 x 3000-pixel image, for example, there are 9,000,000 pixels.

A simple image with a red circle on a black background might appear to be only two colors, but both the red and black areas will likely be composed of tens or hundreds of thousands of adjacent pixels of slightly different colors.

For example, in hexadecimal notation, the red displayed by a pixel might be dc3f15. The adjacent pixel might be dc3f16. Those are two separate colors, but the two colors are indistinguishable to the human eye.

You stated, “I’m trying to find a working and accurate way to calculate how much of specific colors are in a picture.” If I take your statement literally, you’re asking which of those 65,000 possible colors appears more often than the others. In the 3000 x 3000-pixel image I mentioned, for example, 3987 of those pixels might be dc3f15, and 3892 might be the indistinguishable-to-the-human-eye color dcef16.

Red, blue, purple, yellow, or green aren’t specific — they’re subjective ranges of colors, hues, tints, shades, intensities, etc., in the spectrum of millions of possible variations

In other words, an objective, definitive answer to your question about which color appears most often might be the reddish dc3f15. However, a subjective answer to your question might be that there’s more blue in the photo than red.

Color is complicated, and I don’t know of any software application that will provide a meaningful answer to the rather vague question you’ve asked.

This onlline tool tells you the dominant colours

Is it a good idea to be using online software from Ukraine right now?

why would it be a bad idea?

the tool that kind of does what I want is geotests (sorry but the forum does not allow links, just put geotests in google and press the second given link), but sometimes it gives weird, obviously wrong results

This is a bit difficult to explain because it’s conceptually confusing.

Unfortunately, you’re looking for a straightforward solution that doesn’t exist and can’t exist without, first, defining the parameters you want the algorithm to consider.

Going back to my first response, in a 16-bit image, there are 65,536 possible colors. Both the sites that Smurf2 linked to and the one you mentioned (geotests.net) depend on various algorithms to determine outcome values that are based on medians, averages, color thresholds, pixel cluster samplings, etc., of all those possible colors. Depending on how these and other parameters are used, determines how the result is calculated.

Here’s a simple example of why different answers are equally valid depending on which parameters are used.

In the image below, you might say blue is used more than any other color because there is far more blue than purple.

However, all those blue colors consist of thousands of variations of blue — each having its own hexadecimal number. Each of those variations of the blue gradient consists of ~960 pixels of any specific blue. However, the small purple square contains 3480 pixels of a specific purple: hex # 7546b6.

In other words, you might say purple (7546b6) is the main color because that specific color outnumbers any of the specific blue colors.

Depending on the variable used (e.g., how the question is asked), either purple or blue could be the correct answer.

The website Smurf2 linked to uses its own predefined set of parameters in the algorithm. The geotests.net site lets the user determine some of the parameters. If the algorithms are written correctly, they will provide accurate answers, but those answers, by necessity, must be obtained by using the various parameters the algorithm considers.

Thanks a lot you for your responses! There’s one improtant detail about what I’m looking for - the input material that I’m going to work with will only contain 5 colors, so I guess I need to figure out what the settings on geotests do try to stick to that software.

thanks again