Jump to content
How to Install Plugins ×

Color Count


Recommended Posts

Download: At the bottom of the page.

 

 

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

 

 

 

 

 

  • Like 1
Link to comment
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

Link to comment
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.

yhsjjie.png

History repeats itself, because nobody was paying attention the first time.

Link to comment
Share on other sites

  • 2 years later...
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.

Link to comment
Share on other sites

  • 2 years later...
  • 8 months later...

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
Link to comment
Share on other sites

  • 4 years later...

Hi @JonJonz You must close paint.net and restart it after you have put the plugin into the Effects folder.  It is there for me :)

 

color-count.png

30b8T8B.gif

How I made Jennifer & Halle in Paint.net

My Gallery | My Deviant Art

"Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon.

 
Link to comment
Share on other sites

Also, the DLL file need to be extracted from the zip file.

Link to comment
Share on other sites

  • 2 years later...

Thanks for this very useful plugin! It's particularly good when saving images as low-color PNGs, to get an idea how many colours can be sacrificed without affecting quality too much.

 

I was a bit surprised to realize P.N didn't show this information. It seems like it may be worth considering adding a "Properties" window to P.N, openable from the File menu, with stats on the current image, as I seem to remember from other graphics programs. Maybe I'll post a suggestion about that. Maybe you'll agree, it'd also be helpful if we could zoom in on the "Save As" preview, to see that as well as the effect of saving with various levels of JPG compression.

 

Only one thing isn't clear to me about the plugin: Why does it appear in Effects > Photo, rather than Effects > Color? It's about colors, right? It doesn't matter much, as long as one eventually finds it, but it took a bit of hunting in seemingly unlikely places.

 

Anyway, I'm rambling... Thanks again for your nice work. 🙋🏽‍♂️

Edited by anderpainter
Link to comment
Share on other sites

11 hours ago, anderpainter said:

Only one thing isn't clear to me about the plugin: Why does it appear in Effects > Photo, rather than Effects > Color? It's about colors, right? It doesn't matter much, as long as one eventually finds it, but it took a bit of hunting in seemingly unlikely places.

 

The "Colors" menu was only recently added to Paint.NET in v4.2.16 about a year ago, and this plugin was released 13 years ago. So the convention just hadn't been established.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...