How can I save only one color channel, such that it would only take 1 byte per pixel?

I only want to save the alpha channel and apply colors later using a custom shader. But all the formats I tried so far take more memory than necessary. For instance, 8x8 image should only take 64 bytes. Is there any image format that allows this?


Microsoft BMP files have a "monochrome" mode which uses just one bit per pixel (the file is still slightly larger due to meta-data).

Note that this only applies to the actual graphic files. When you have your graphics framework unpack the image files to textures, the required texture memory might be more than 1bpp.

  • \$\begingroup\$ I just found out that in Unity, Alpha 8 format does exactly that \$\endgroup\$ – Riko Jul 22 '16 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.