2
\$\begingroup\$

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?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .