Question

A 24 bit .png file with transparency, as those that can be generated with Photoshop, has really 24 bits distributed across each color plus the alpha ? or the 24 bit refer only to the colors and ignores the alpha (RGBA 8888).

Is there any tool to examine a PNG file and verify this kind of information? Does Photoshop have any options to verify or configure this?

Was it helpful?

Solution

24 bit + alpha is actually 32 bits per pixel. Meaning you have the Red, Green, Blue and Alpha channels, each being 8 bit, allowing for 256 shades per channel translating to 256 x 256 x 256 x 256 possible colour combinations. That's what the "millions of colours" and "billions of colours" mean in certain graphics and video software.

OTHER TIPS

As I understand it, there are three kinds of "24 bit" pngs:

  1. 24 bits with no transparency. No alpha information, truly 24 bits per pixel.

  2. 24 bits per pixel with alpha transparency. This would be 24 bits of color information with 8 bits of alpha (allows for various levels of transparency) - 32 bits per pixel total.

  3. 24 bits per pixel with binary transparency. This would be 24 bits of color information with 1 bit of alpha (transparent or not transparent) - 25 bits per pixel total.

24 bit PNG doesn't say much. An image has a pixel format. The pixel format describes the Colorspace used (such as CMYK, RGB) and bits per channel information (i.e. how many bits are allocated to represent each channel of the colorspace in use).

Go to File > File Info > Advanced. That should tell you what you are looking for.

After dissecting the exported file myself (from Photoshop CS6), I found that the "24 bit" file generated by Photoshop is actually still 8 bit. The RGBA is still one byte per channel. The IHDR PNG chunk still says that it's 8 bits per channel.

It's an 8 bit PNG.

The exported PNG also contains about 825 bytes of useless marketing text data (per PNG image).

See the image (with the byte for "bits per channel" selected):

enter image description here

See the specification for more details:

http://www.libpng.org/pub/png/spec/1.2/png-1.2.pdf

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top