[vox-tech] count pixels
Wade Pinkston
blata at extent0006.entomology.ohio-state.edu
Thu Feb 22 07:29:09 PST 2007
I made this image with gimp as a test image. The image is 100% #ff0000
no matter what I convert the image to I don't get a pixel count.
$ identify -verbose red1.tiff
Image: red1.tiff
Format: TIFF (Tagged Image File Format)
Geometry: 256x256
Class: DirectClass
Colorspace: RGB
Type: Palette
Depth: 1 bits
Endianess: MSB
Channel depth:
Red: 1-bits
Green: 1-bits
Blue: 1-bits
Channel statistics:
Red:
Min: 1
Max: 1
Mean: 1
Standard deviation: 0
Green:
Min: 0
Max: 0
Mean: 0
Standard deviation: 0
Blue:
Min: 0
Max: 0
Mean: 0
Standard deviation: 0
Colors: 1
Histogram:
Rendering-intent: Undefined
Resolution: 72x72
Units: PixelsPerInch
Filesize: 192kb
Interlace: None
Background Color: white
Border Color: #DFDFDF
Matte Color: grey74
Dispose: Undefined
Iterations: 0
Compression: None
Orientation: TopLeft
document: /home/blata/red1.tiff
comment: Created with The GIMP
signature:
d764b5e26d0f9155ebf131dcbf35ecaae5b3508c4b7d240173f5fe85b406ae64
Tainted: False
User Time: 0.000u
Elapsed Time: 0:01
This image is the same with three white ovals cut out of the red. Again
no pixel count. If I could get a simple pixel count per color then I
can do the math and all is good.
identify -verbose red2.tiff
Image: red2.tiff
Format: TIFF (Tagged Image File Format)
Geometry: 256x256
Class: DirectClass
Colorspace: RGB
Type: Palette
Depth: 8 bits
Endianess: MSB
Channel depth:
Red: 1-bits
Green: 8-bits
Blue: 8-bits
Channel statistics:
Red:
Min: 255
Max: 255
Mean: 255
Standard deviation: 0
Green:
Min: 0
Max: 255
Mean: 32.4795
Standard deviation: 84.5242
Blue:
Min: 0
Max: 255
Mean: 32.4795
Standard deviation: 84.5242
Colors: 105
Histogram:
Rendering-intent: Undefined
Resolution: 72x72
Units: PixelsPerInch
Filesize: 192kb
Interlace: None
Background Color: white
Border Color: #DFDFDF
Matte Color: grey74
Dispose: Undefined
Iterations: 0
Compression: None
Orientation: TopLeft
document: /home/blata/red2.tiff
comment: Created with The GIMP
signature:
1e69860505dfe98ecbede60074549452546deb485ce49723f2feb62ab73b40c9
Tainted: False
User Time: 0.000u
Elapsed Time: 0:01
Troy Arnold wrote:
> On Wed, Feb 21, 2007 at 07:27:20PM -0800, Wade Pinkston wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Hello, I need to process some images and count the number of pixes of a
>> given color.
>>
>> A little background. I want to take pix of leaves against a mat
>> background. The leaves are then subjected to damage. I'll then take a
>> duplicate photo. Now what I want to do is subtract out the colors of the
>> leaf leaving only a two tone image.
>>
>> I was hoping to find a way to then use ImageMagick or Gimp to count the
>> pixels of color so I can then get a percent change between the two images.
>>
>> Does anybody know how to get ether of these two programs to give this type
>> of information. Actually any software would be help full.
>
> If the image is in an indexed format, you can use identify from the
> imagemagick suite:
>
> $ identify -verbose some.gif
> [...]
> 155: (238,238,238, 0) #EEEEEE00
> 244: (245,245,242, 0) #F5F5F200
> 264: (249,249,249, 0) #F9F9F900
> 139: (252,252,252, 0) grey99
> 3885: (255,255,255, 0) white
> 3197: (235,235,217,255) #EBEBD9FF
>
> [...]
> This shows that this image has 3,885 white pixels.
>
>
> -troy
>
>
>
> _______________________________________________
> vox-tech mailing list
> vox-tech at lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
--
Wade Pinkston
Ipsa scientia potestas est
Windows,a
32 bit graphical interface for a
16 bit patch to an
8 bit operating system internally coded for a
4 bit processor written by a
2 bit company that can't stand
1 bit of competition
More information about the vox-tech
mailing list