Printing image attributes using special format characters

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
robinesque

Printing image attributes using special format characters

Post 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
immortal26

Re: Printing image attributes using special format character

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Printing image attributes using special format character

Post 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
Post Reply