Page 1 of 1

Printing image attributes using special format characters

Posted: 2010-08-03T23:47:03-07:00
by robinesque
I'm trying to Print an images "Palette size" by embedding special format characters. The IM special characters page (http://www.imagemagick.org/script/escape.php) doesn't list a special character for palette size. I tried several similar special characters, like %q and %z, and could not find the right one for palette size. Is there a special format character that can print the palette size? Thanks

Re: Printing image attributes using special format character

Posted: 2010-08-04T11:10:54-07:00
by immortal26
Take a look here:
http://www.imagemagick.org/Usage/basics/#ping

trying using -identify -ping on the image to find the pallate size.

Re: Printing image attributes using special format character

Posted: 2010-08-04T12:40:10-07:00
by fmw42
this works:

convert rose: -type palette rose_palette.gif

colormap=`identify -verbose rose_palette.gif | sed -n 's/^.*Colormap:[ ]*\(.*\)$/\1/p'`
echo $colormap
256