Sign in to follow this  
stuff_gnome

Color Count

Recommended Posts

Download:

ColorCount.zip

What does this plug-in do?

This plug-in does exactly what its name implies, it counts the number of colors (or number of times a color is used) in an image.

How does this plug-in work?

What probably needs the most explanation is use of the control options for this plug-in, this is best described with screen shots. The following screen shots show an image that is

3 pixels by 3 pixels at maximum zoom.

The image below shows the result of selecting to “count only the primary color.” In this case the primary color chosen is red with an alpha of 255, not transparent. The “ignore alpha” option serves to either narrow or widen your color search, in this case we are narrowing our search down to only red pixels with an alpha value of exactly 255.

uicc3.png

In this next screen the option to ignore alpha values is chosen, widening the search to count any red pixel in the picture.

uicc4.png

Ok, this is where it can get confusing. This time instead of counting the occurrence of a specific color we are going to do the exact opposite, which is to count the number of all the unique colors used. Continuing with the idea of doing things opposite from before, this time selecting the “ignore alpha” option will narrow our search results, confused yet?

The next screen shot shows the result of counting colors while treating colors with differing alphas as individual colors themselves.

uicc1.png

Now here is the result of ignoring alpha values, effectively treating all colors as if they had the same alpha value.

uicc2.png

Location?

Effects > Photo > Color Count

If you have any questions, suggestions, or something does not work properly for you please let me know.

Download:

ColorCount.zip

Share this post


Link to post
Share on other sites

@MyChemicalSnowman

Your welcome, I had noticed some posts here and there mentioning the need/want to count the number of pixels of a specific color in an image and thought, "Hey, I can do that!"

@Boude

I don't think I completely understand what you are asking for, could you go into a bit more detail about your idea? Would this tolerance be based on the primary color chosen? Are you talking about measuring something like perceived color rather than actual color? I was going for something that worked around absolute rather than relative values, but I can be flexible.

On a related note, I had planned to add the ability to count the occurrence of a set of colors found in any given pnd palette file. Once a figure out how to read a pnd pallete file that is

Share this post


Link to post
Share on other sites

I mean that it doesn't count the amount of pixels with the exact same color as the primary, but it counts the amount of pixels that are similar to the primary color and then using a tolerance slider to set how similar they have to be to the primary color, a bit like the tolerance slider of the fill bucket tool.

Share this post


Link to post
Share on other sites

this doesn't work for images with vast numbers of colours, for example those on allrgb.com

I've attached an example image. It (the full size version, linked) contains 16777216 colours, but this plugin reports that it contains only 4664751 colours.

PBq9Vl.jpg

Share this post


Link to post
Share on other sites

From an image of a total 746550 pixels, I counted (primary color=black) to be 506,258.

If i press recount, this number changes anywhere from 200,000 to 900,000.

what is this recount? what is it recounting? why do the numbers vary so much??

Share this post


Link to post
Share on other sites
Guest Erooth

this doesn't work for images with vast numbers of colours, for example those on allrgb.com

I've attached an example image. It (the full size version, linked) contains 16777216 colours, but this plugin reports that it contains only 4664751 colours.

PBq9Vl.jpg

Hey..I like your work, The effects that you have used in here are really awesome. Must have got some training for making such patter and others too.. If you have others too... Please share them with us. Want to see more.

Share this post


Link to post
Share on other sites

How to install this plugin? I downloaded and when I tried to open it says it cannot be opened?!

 

I would really like to use this. Could someone help me?

Share this post


Link to post
Share on other sites

Hi,

Thank you for the wonderful software. I can see how i can count the number of colors but i'm not quite sure how to count the number of pixels of a particular color. I would really appreciate if someone could help me with that.

 

Thanks,

Sajjeev

Share this post


Link to post
Share on other sites

For this you can use the Magic Wand :MagicWandTool:

 

1. Activate the magic wand :MagicWandTool:

 

2. Lower the Tolerance in the Tool Bar to zero.

 

3. Hold down the Shift key (to force a Global selection) and click on a pixel of the target color.  The number of pixels selected is shown in the Status Bar.

 

What just happened here?  Well, zero Tolerance means only pixels of an exact color match to the one clicked on will be added to the selection.  The Shift key forces the selection to Global which adds every pixel in the layer which satisfies the Tolerance setting (exact matches).

 

In short we're selecting every pixel in the layer which exactly matches the one you clicked on.  The number of pixels in the selection is shown in the Status Bar.

  • Upvote 1

Share this post


Link to post
Share on other sites

 

The number of pixels in the selection is shown in the Status Bar.

I'd never noticed that for the magic wand - thanks! ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this