Jump to content

count red pixels


Recommended Posts

There is no unfree version. :-)

But no, there is no way.

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

You could.... I guess (if you are measuring the % of red in a square) you could do it a hard way (if anyone has better, reply and put me to shame.)

drag your selection down to the bottom of your red for example, then look at the "bounding rectangle size," multiply the width by the height, then the width by the height of the whole canvas. Then divide the larger by the smaller and multipy that by 100. Simple!

(Canvas width*Canvas height)/(Selection width*Selection height)*100

(800*600)/(800*432)*100 = 72% red pixels (but this ONLY works for SQUARES if not then there is no other way than to manually count them :wink:)

Link to comment
Share on other sites

drag your selection down to the bottom of your red for example, then look at the "bounding rectangle size," multiply the width by the height, then the width by the height of the whole canvas. Then divide the larger by the smaller and multipy that by 100. Simple!

That's assuming all of the red is in one block.

KaHuc.png
Link to comment
Share on other sites

(but this ONLY works for SQUARES if not then there is no other way than to manually count them :wink:)

"SQUARES" should be "Rectangles". A square is a rectangle too. One with a all sides equal. :P

Also, it only works with 1 single rectangular selection. Having 2 rectangular selections with a space between wouldn't work.

Merry Christmas

 

.::.My Gallery.::.Make Gold Text!.::.

Link to comment
Share on other sites

That's assuming all of the red is in one block.

Yes, which is very unlikely :P I guess if someone had the time they could make a plugin that does this for you but I don't think many people would use it, so I doubt it will ever be made.

Oh, you could do 2 rectangualr selections or more, just do one, then the other then add them together (%) :D

Link to comment
Share on other sites

Um... when you create a selection, sure you see the selection width and height.... but you also see the actual size in pixels.

So just use magic wand to select globally all the red you want, and just read the number in the status bar? No percentages, no calculating.... just reading a number?

sig.jpg.7f312affa740bae49243c4439bc4a244.jpg

Link to comment
Share on other sites

Now correct me if I'm wrong, but using the wand with a tolerance of 0% and flood mode of global should select every instance of your (clicked on) target colour. Isn't that right?

If I'm correct, then once you have your selection, the above post by Zagna shows us where to find the number of currently selected pixels.

Is this not easier than writing a plugin or am I missing something?

Link to comment
Share on other sites

The only catch is that you first have to find a pixel that is the color you want.

Or, just temporarily set any pixel to that color, do the magic wand thing, then subtract 1 from the area. Then undo the pixel's color.

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

I doubt someone would want to find the percentage of pixels in an image that are a colour they can't even find. :?

Isn't that what computers are for? Plus it's quicker to find via the method I just mentioned than to do so manually (depending on image size, of course).

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

Let's say that this is a compressed JPEG photo and you accidentically deleted the PDN file. Now you want the transperancy back, but the magic wand always leaves something left. Maybe there is a lot of small places where there is white between the actual object, like on photos of trees, bushes, plants etc. That is why that a tool like this could be usefull :wink:

Link to comment
Share on other sites

Look for the Color To Alpha Plugin. Or just put the Magic Wand on Global mode. :-)

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

So, I expect that you just do a fast magic wand on art like this?

Texture.bmp

Whoa. That is killing the selection render performance on my v3.5 Alpha here. Looks like I found a good performance test case. Thanks ;)

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.

 Share

×
×
  • Create New...