Re: Calculating Area of Scanned Image

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Phil Platt (phil_at_philipgrae.dabsol.co.uk)
Date: 07/22/04


Date: Thu, 22 Jul 2004 23:09:16 +0100

Hi Michael.

You need an image processing program, such as Photoshop. This will give you
a lot of information, for example the percentage of the image that is red.

In a bitmap, the fact that a pixel is red or any other colour doesn't affect
the file size - every pixel has the same amount of colour information and it
only varies according to the number of colours that can be assigned to a
pixel - eg 8, 16, 24 or 32 -bit. Also the resolution of the image affects
file size.

JPG assesses 8 x 8 pixel blocks in an image and assigns a single value to
the most common colours in the block, using an affiine cosine transfromation
algorithm. In short, it degrades the image by removing subtle colour tones.

The higher the quality you choose when saving the file, the less degradation
it does, and thus the best quality images are always larger files.
Incidentally you notice a lot less degradation with files that have a
majority of blue pixels 'cos the human eye can't detect as many shades of
blue as it can any other colour... thus highly-compressed seascapes look
better that the equivalently-compressd landscapes!

Anyway, try Photoshop's image calculation routines, they should provide you
with what you need.

(I think Paintshop Pro may offer similar functionality, and it's cheaper!)

HTH
Phil

"ntegrat61" <ntegrat61@discussions.microsoft.com> wrote in message
news:0F47D9E2-39FE-4EFC-841E-9AE9DD61E5EF@microsoft.com...
> Does anybody know of a windows program (maybe Excel) that would calculate
the area (in pixels or any other unit) of a scanned image?
>
> For example, if I were to draw circles on a sheet of paper, scan the paper
into my computer, and then fill the circles with red paint in Microsoft
Paint, is there a way to find out the area on the screen that the red paint
occupies? I am hoping there may be a program that counts red pixels, for
example.
>
> I tried to relate file size (in bytes) to amount of red paint, but there
doesn't seem to be a relationship. If the files are saved as a bitmap, for
example, they are all the same size regardless of the amount of color the
image contains. If the files are saved as *.jpg, the file with less color
turned out surprisingly larger.
>
> If I can quantify the amount of red color in any way, I will be able to
convert into the units mm^2 because I can also scan a calibration square
that is known to be 1 mm^2.
>
> Thanks a lot.
>
> Michael



Relevant Pages

  • Re: resizing JPEGs (with Img and photo image)
    ... variable for the amount to expand by.... ... # check coef ... # weight each initial pixel by cx & cy ... satellite imagery superimposed over ...
    (comp.lang.tcl)
  • =?iso-8859-1?Q?Re:_=5BNMZ=5DSch=FClerzirkus?=
    ... Amount: 150% ... Radius: 0,3 Pixel ... Nun hast Du eine moderate Nachschärfung, ohne aber das Rauschen im Bild zu verstärken und ohne starke Schärfungstreppchen oder Artefakte. ...
    (de.rec.fotografie)
  • Re: Efficient visualization of pixmaps
    ... of computation just to get the color of a single pixel. ... to see that Microsoft's pixel setting routines were the bottleneck of my ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: BeHIT Newsletter
    ... >> if red paint on the road surface isn't enough, then no amount of ... >> signage is going to help. ... > as I replied elsewhere red paint alone does not mean cars forbidden! ...
    (uk.rec.cycling)
  • Re: Expanding all the boundaries in width and height.
    ... all I need is to replace every pixel in the input ... image with a circle of pixels with radius d (the amount of increase ...
    (comp.graphics.apps.gimp)