16
5
I have PNG image files on Mac OS X. How can I find out if an image is 24 bit color or 32 bit color?
16
5
I have PNG image files on Mac OS X. How can I find out if an image is 24 bit color or 32 bit color?
20
Mac OS X also comes with a utility built into it called sips that could be used to query and manipulate different attributes of image files. As an example, you could use the following command to display all image properties associated with the image:
sips -g all image.png
2The relevant sips
properties are samplesPerPixel
and bitsPerSample
. – Daniel Beck – 2012-02-02T19:03:50.497
3By the way, if you can use another answer by 1:1 copying it, the question's most probably a duplicate. In this case, please don't answer it, but flag
it for moderator attention to have it closed as a dupe instead. – slhck – 2012-02-02T21:42:08.513
Ah, so do you just choose 'it needs moderator attention', choose other, and then write in duplicate? – Ryan – 2012-02-02T23:19:21.803
1@Ryan: "It doesn't belong here" -> "Exact Duplicate" -> Paste link. – Tamara Wijsman – 2012-02-03T11:56:05.857
12
pngcheck will give a succinct description (and any errors, should they exist):
$ pngcheck *.png OK: sample24.png (128x128, 24-bit RGB, non-interlaced, 89.7%). OK: sample32.png (128x128, 32-bit RGB+alpha, non-interlaced, 78.0%). No errors were detected in 2 of the 2 files tested.
Mac binaries available on supplied link.
Good answer - the sips suggestion didn't work for me - Both png-8 and png-24 files are reported as 8 bit sRGB. Another working answer is also file *.png
- no extra installs required. png-8 will show as "colormap" whereas png-24 shows as "color RGB". – Jonny – 2014-06-25T07:13:10.880
3
If you are on a Mac and have homebrew, you can install it with: brew install pngcheck
7
ImageMagick's identify
utility (command line) will show you all sorts of info about images in a range of formats.
identify -verbose <image file>
If your image is 24 bit you will see:
Channel depth: red: 8-bit green: 8-bit blue: 8-bit
If your PNG image is 32 bit you will see:
Channel depth: red: 8-bit green: 8-bit blue: 8-bit alpha: 8-bit
There will be a lot of other information displayed as well.
4
You can query Spotlight's metadata index using mdls
:
mdls -name kMDItemBitsPerSample filename.png
kMDItemBitsPerSample = 32
The results seem a bit odd though. mdls -name kMDItemHasAlphaChannel
might be more relevant here.
3
In addition to what has been suggested, Mac OS X comes with a utility built into it called sips that could be used to query and manipulate different attributes of image files. As an example, you could use the following command to display all image properties associated with the image:
sips -g all image.png
1Questions were merged, that's why there are duplicate answers. – Daniel Beck – 2012-02-03T11:59:03.097