4

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
José Joel.
  • 2,040
  • 6
  • 28
  • 46

4 Answers4

7

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.

Soviut
  • 88,194
  • 49
  • 192
  • 260
  • Thanks for Your answer. And it's there any possible way to save it in a 24 bit format which includes alpha ? using photoshop or any other tool. – José Joel. Dec 18 '09 at 20:22
  • 1
    @José, you're asking for 6 bits per channel. That format does not exist in PNG, nor in any other format I'm aware of. – Mark Ransom Dec 18 '09 at 20:31
  • 1
    @José: Theorietically you could for example have a format with 8 bits of alpha combined with the 5+6+5 color format. There is no such PNG format though. – Guffa Dec 18 '09 at 20:32
  • @Jose, no, you need to store that alpha information somewhere, that's what the alpha channel is for. – Soviut Dec 18 '09 at 21:15
6

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.

Eric Petroelje
  • 59,820
  • 9
  • 127
  • 177
  • Apple's openGL ES programming guide recommends using RGBA5551, or RGBA4444. Those formats contain alpha ? – José Joel. Jan 02 '10 at 02:05
  • @Jose - Yes, hence the "A" in the RGBA. RGBA5551 would have 5 bits of each color + 1 alpha bit. RGBA4444 would have 4 bits of each color + 4 bits of alpha. So those would actually be 16 bit formats. – Eric Petroelje Jan 04 '10 at 13:35
  • Binary transparency reserves one color for transparency (like in GIF), so that's still 24bit + fixed-size metadata. – Kornel Jul 22 '13 at 17:10
0

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

Homer6
  • 15,034
  • 11
  • 61
  • 81
0

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.

dirkgently
  • 108,024
  • 16
  • 131
  • 187