hello!
in a photo, I want to calculate the area that a specific color occupies
how can I do that?
thanks!
in a photo, I want to calculate the area that a specific color occupies
how can I do that?
thanks!




the pixels are in a shape or placed randomly?
With my ancient version of photoshop, I can select pixels of similar, or the same colour.
If I set it to same colour (Tolerance=0) it mostly only selects a handful of pixels.
I presume that's not what you want - but I'm not sure.
Maybe you could explain a bit more?
With my ancient version of photoshop, I can select pixels of similar, or the same colour.
If I set it to same colour (Tolerance=0) it mostly only selects a handful of pixels.
I presume that's not what you want - but I'm not sure.
Maybe you could explain a bit more?
this is what I want exactly, but I need to quantify this selection as a percentage of the whole photo or as an absolute square inches etc
or maybe I can create another photo with only this selection of pixels and then count the pixels?
(my version of photoshop is no help in getting the percentage)
I just can't resist that!)this is what I want exactly, but I need to quantify this selection as a percentage of the whole photo or as an absolute square inches etc


thank you very much!
but, what about photos, where similar colors form an area or multiple areas, which must be counted?
maybe we can input many color codes, but again, how can we determine similar color codes in a photo?
it works exceptionally well with vector graphics, but with raster images, it seems bothersome (like many other stuff with rasters)

private string SomeOtherMethod(string imgPath, Color compareColor)
{
// http://stackoverflow.com/questions/6020406/travel-through-pixels-in-bmp
Bitmap bmp = new Bitmap(imgPath);
int count = 0;
int total = 0;
for (int ii = 0; ii < bmp.Width; ii++)
{
for (int jj = 0; jj < bmp.Height; jj++)
{
Color pixelColor = bmp.GetPixel(ii, jj);
// do stuff with pixelColor
if (pixelColor.R == compareColor.R && pixelColor.G == compareColor.G && pixelColor.B == compareColor.B)
{
count++;
}
total++;
}
}
decimal percent = (Convert.ToDecimal(count) / Convert.ToDecimal(total)) * 100;
return "Counted " + count.ToString() + " pixels of " + total.ToString() + " (" + percent.ToString() + "%)";
}(pixelColor.R <= compareColor.R + 5) && (pixelColor.R >= compareColor.R - 5) && (pixelColor.G <= compareColor.G + 5) && (pixelColor.G >= compareColor.G - 5) && (pixelColor.B <= compareColor.B + 5) && (pixelColor.B >= compareColor.B - 5)

is there a simple way to quantify the pixels of these skin moles?
http://www.gulfmd.com/images/skinchart.gif
also, how will I know that all the pixels are selected? a line that will mark the area would be helpful

That's the first problem for the Magic Wand - You must manually select all similar colour patches yourself, which defeats the purpose of doing it manually.
Original address: https://www.donationcoder.com/forum/index.php?topic=29896.0