Understanding 24 bit PNG generated with Photoshop

江枫思渺然 提交于 2019-12-04 03:36:42

问题


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?


回答1:


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.




回答2:


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.




回答3:


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.




回答4:


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):

See the specification for more details:

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



来源:https://stackoverflow.com/questions/1930439/understanding-24-bit-png-generated-with-photoshop

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!