[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to count % color coverage?



ciao Igor Khavkine,

> You need the netpbm package.
> 
> $ giftopnm image.gif > image.ppm
> $ pamfile image.ppm   # get the dimension
> image.ppm:       PPM raw, 50 by 48  maxval 255
> $ ppmhist image.ppm   # create histogram
>    r     g     b         lum     count
>  ----- ----- -----      -----   -------
>      0     0     0          0      1631
>     51    51    51         51         9
>    166   166   166        166         9
>    136   136   136        136         9
>    161   161   161        161         8
> [...]
> 
> The colors are given by RGB values and count is the number of pixels
> of given color. Divide by the total number of pixels for percentages.

thank you!
together with identify (imagemagick) these are THE solution.

-- 
Paolo Pedaletti



Reply to: