How to tell an 8-bit indexed PNG from a 24 bit RGB PNG

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
goofy166
Posts: 2
Joined: 2018-03-08T11:09:06-07:00
Authentication code: 1152

How to tell an 8-bit indexed PNG from a 24 bit RGB PNG

Post by goofy166 »

Is there a way to use ImageMagick from the command line to determine the bit depth of a PNG?
I am using Photoshop to do this and it seems to give me contradictory results. Specifically I am using the Photoshop File->File Info menu.

Thanks

Mitch
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to tell an 8-bit indexed PNG from a 24 bit RGB PNG

Post by snibgo »

goofy166 wrote:Is there a way to use ImageMagick from the command line to determine the bit depth of a PNG?
IM isn't designed to tell you anything about the contents of a file. exiftool is designed to do that.
snibgo's IM pages: im.snibgo.com
goofy166
Posts: 2
Joined: 2018-03-08T11:09:06-07:00
Authentication code: 1152

Re: How to tell an 8-bit indexed PNG from a 24 bit RGB PNG

Post by goofy166 »

OH thanks I really appreciate this answer. I will download it. I am not a command line jock and on a Mac. Do you happen to know the terms I need to feed exiftool to get it to tell me the file details?

Mitch
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to tell an 8-bit indexed PNG from a 24 bit RGB PNG

Post by snibgo »

Once you've downloaded exiftool:

Code: Select all

exiftool myfile.png
Look out for:

Code: Select all

Bit Depth                       : 8
Color Type                      : Palette
... or ...

Code: Select all

Bit Depth                       : 16
Color Type                      : RGB
snibgo's IM pages: im.snibgo.com
Post Reply