RGBA4444 format in PNG

28 Views Asked by At

I've seen some references to the RGBA4444 format, and from what I gathered, it is an RGBA format with 4 bits/channel, 4 channels per pixel, correct?

Is this possible to do in a PNG file? According to the PNG specification, only RGBA images with a bit depth of 8 or 16 bits are allowed (https://www.w3.org/TR/2003/REC-PNG-20031110/#11IHDR), meaning RGBA4444 is not PNG compliant.

Can someone elaborate on what RGBA4444 is?

Thanks!

1

There are 1 best solutions below

0
Mark Adler On

Yes, it is one of several Unity 16-bit per pixel texture formats. (Also RGBA5551, RGB565.)

You could simply store such an image as a PNG using 32 bits per pixel, RGBA with 8-bits per color. Since half the bits will be zero, the Huffman coding in PNG's compression will effectively use about four bits per color instead of eight in the compressed image anyway. And likely less, if there is other redundancy in the image or limited use of the color space.