Need color counting tool

Souron

The Dark Lord
Joined
Mar 9, 2003
Messages
5,947
Location
(GMT-5)
I need a free program that would allow me to count the number of pixels a said color posses.
For example, If I ask for blue, the program would tell me the exact number of pixels that are that particular shade of blue, in a given picture.

Prefered if functional with at least 16 colors, though red-blue-green count is OK.
Bitmap is the only file format I need.

Reccomendations would be apreaciated. Thanks in advance.
 
Maybe I am misunderstanding you, but colours are made from different shades of red, green and blue. In a 16.7 million colour system, the intensity of the primary colours ranges from 0 to 255, 0 being black, 255 being fully on. e.g 255,255,255 would be white, 0,0,0 being black, 255,0,0 being red, etc. If this is what you mean then I can help you.

Second thoughts...do you mean the mixing of different colours to simulate another colour from a distance? Dithering?
 
I just need a tool that can count the ammount of a particular shade of color in an immage.

Ideally it would count the amount of every color on a 256 color pallet, but something simpler would work. For example if a tool could tell me the amount of white an a binairy immage, I could work with that.

And By 16 colors I ment 16 colors, not 16.7 million.
 
Any paint program should be able to do that.

Do you mean this? Or do you want to see what RGB/HTML color the pixel is?
 
No that's not what I need.

I need something that if I give it a picture and a color, it outputs the number of times that color apears in the picture (in pixels).

Simmilar tools could work, such as outputting the amount of red in the picture.

Paint and other immage editors that I have cannot do it.
 
Ohh.. So, you mean like, "3,920 blue pixels", "2,000 red pixels"?

Do you mean something like this: (where it shows the number of pixels)
ct_pixelcount.gif


Or something where you click on a pixel and it shows you how many of that pixel there are?


Is this a programming project you're doing? Sounds like one of those "Read an image file and count the number of X pixels" kind of thing.
 
Paint Shop Pro can do something similar, I think...
 
Paint Shop Pro can tell you how many unique colours there are in an image, not the amount of a certain RGB value. I wouldn't think would be too hard to write a utility for (esp. if it's in bitmap format) but it's one of those things that I would think very few people have a use for and therefore not included in a general program.
 
I just thought of something -- a tool like this would be good for the NES thread, if they wanted to give a specific number of pixels to each 'nation'. :) So, what exactly is this for? I did see one scant mention of it on Google... (counting pixels by color)
 
Chieftess said:
Ohh.. So, you mean like, "3,920 blue pixels", "2,000 red pixels"?

Do you mean something like this: (where it shows the number of pixels)
ct_pixelcount.gif


Or something where you click on a pixel and it shows you how many of that pixel there are?


Is this a programming project you're doing? Sounds like one of those "Read an image file and count the number of X pixels" kind of thing.
Yeah, that is exactly what I need, if I'm reading the immage correctly. I assume the #000000 is the color value. If yes, whatever you have their is perfect.

Basicly I have an immage with about 8 colors on it and I need to find the area of each color.

I don't care how it works, but I need it to be a number, not just select all pixels of that color.

I need unique colors not RBG, but if something can tell me the exact number of (for example) red pixels, I could adapt that.

And I don't have Paint Shop pro.
 
Souron said:
Yeah, that is exactly what I need, if I'm reading the immage correctly. I assume the #000000 is the color value. If yes, whatever you have their is perfect.

Basicly I have an immage with about 8 colors on it and I need to find the area of each color.

I don't care how it works, but I need it to be a number, not just select all pixels of that color.

I need unique colors not RBG, but if something can tell me the exact number of (for example) red pixels, I could adapt that.

Ohh, so it's the area, not the number of pixels? :confused: That might be a bit more complex... Can I see some sample images of what it might look like?
 
It's Number of pixels.

Area in pixels is basicly the same thing, as far as I know, exept I need if for more than one shape. (The immage in question, which is not ready yet, is made up of only 8 colors, so the area of a color is the same as the number of pixels of that color)
 
That "program" I made was some quick control-placement. ;) It's not really functional.
 
Chieftess said:
That "program" I made was some quick control-placement. ;) It's not really functional.

:lol: :lol: :lol: Is there even a program that can do what he's talking about?
 
In theory, it should be quite simple (provided you knew the bmp file format - I can never seem to find file formats for some reason. :undecide:).

1 - Read the size of the image (tells how many pixels total there are).
2 - Set a data structure to that size.
3 - Read the data.
4 - Sort the structure (otherwise searching will take forever). (Treesorts work best I think).
5 - Read the first record, and continue until the value is different (different pixel). That's the number of X-colored pixels you have.
6 - Place that value, and the value of the color, into a listbox (or another structure). If you want to be fancy, make the background of the line whatever that color is, and check if it's light/dark (to change the font color).
7 - Repeat steps 5 and 6.
 
I must say I am curious as to why you woul dneed such a tool. I am sure it has a use, especially for 256 color palettes. Or perhaps for automatically reading statistics based on a simulation map output.
 
I am making a map that has very persice requirement for how many pixels per color. At this point the map is actually done, exept for checking the colors to make sure they add up (which they don't), and figuring out how far off I am.

Actually, something that works with black and white immages would probably be eaziest to create, and would still be usefull. Then it would be a simple if bit is one, add one to variable, go on to next bit.
 
Well guess what?

I don't know if you found something within the month, but I just found out something in .Net where it can simply read the image file, AND has a pixel selection function! I now have a working copy of just what you want. ;)

I only have to make it load a file (unless you want to put your files in the c drive and save them as temp.gif...), and make the form look prettier. Only one thing though - it requires the .NET framework. WinXP systems should have it.

EDIT: Here's a screenie:

ct_pixelprog.gif
 
Pixel Count.

Here's the file. It might have some debug info left over, but it does the job.

Note: Don't use too large of files, since I purposely put in a bubble sort (for smaller images). This also uses the .NET framework (grr, Microsoft! :mad: ), so you may have to download an approx. 105-108 meg file from Microsoft. :gripe: :aargh: :wallbash: :spank:

Download the .NET Framework if you get any kind of "Application Failed to Initialize" error. Also, the pixel info listbox (one on the left) is disabled to speed up the program a bit.
 
Back
Top Bottom