[magick-users] Number of colors (identify -verbose)

Anthony Thyssen anthony at griffith.edu.au
Mon Nov 5 18:25:29 PST 2007


Al Bogner on  wrote...
| Am Montag, 5. November 2007 03:17:02 schrieb Anthony Thyssen:
| 
| > | I changed from Suse 10.2 to Suse 10.3, which changed the IM version too
| > | from
| > |
| > | Suse 10.2
| > | identify -version
| > | Version: ImageMagick 6.3.0 10/12/07 Q16
| > |
| > | Suse 10.3
| > | identify -version
| > | Version: ImageMagick 6.3.5 09/25/07 Q16
| > |
| > | Suse 10.2
| > | identify -verboset test.jpg | grep "Colors:"
| > |   Colors: 373602
| > |
| > | Suse 10.3
| > | no result
| > |
| > | Was the number of colors removed or did Suse something wrong?
| >
| > Errr..  try removing the 't' from   "-verboset"
| 
| Thanks, this was a typo
| 
| > And you are right 'Colors:' appears missing.
| >
| > But you can get them using
| >    identify -format %k test.jpg
| 
| This works fine.
| 
| > NOTE: the number of colors in a JPEG image is actually rather usless as
| > a jpeg does not store 'colors' but foruier waves.  That is the actual
| > color is generated whenever the image is read, often resulting in a
| > unique color for each and every pixel.
| 
| I don't need an exact value. I want to compare pictures with less or more 
| colors and I round it to 100000, eg. 
| http://www.flickr.com/photos/tags/colors700000/
| 
Segment continued...

For example..
   convert 599072425_deea87f49b.jpg -segment 25x1.5 -format %k info:-
   7

shows that while the image is very complex (a swamp), it really only has
a limited number of types of objects.

On the other hand...
   convert 812688028_940b21097f.jpg -segment 25x1.5 -format %k info:-
   32

Shows that this image (a rack of teeshirts) is much more complex.
Of course the algorition took longer too.

NOTE: -segment is related to -colors but is not trying to reduce the
number of colors to a specified number, just find out how the colors
group together.

PPS: I would remove the frames from the image before attempting to
segment the image.  The algorithm also does not work well for small
images.

  Anthony Thyssen ( System Programmer )    <A.Thyssen at griffith.edu.au>
 -----------------------------------------------------------------------------
 Two hydrogen atoms walk into a bar. One says, "I've lost my electron".
 The other says, "Are you sure?" The first replies, "Yes, I'm positive..."
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/


More information about the Magick-users mailing list