<p>Here is an article about the BCn format: <a href="http://www.reedbeta.com/blog/understanding-bcn-texture-compression-formats/" rel="nofollow noreferrer">click me</a>. It is written by Nathan Reed, who is quite active on this site. So he will probably pass by and might answer your question with more details, even though I think the article will explain everything you need to know.</p>

<p>The most relevant part for your question seems to be this section from the article:</p>

<blockquote>
  <p>BC stands for “block compression”, and the BCn formats <strong>all operate in terms of 4×4 blocks of pixels.</strong> All images are sliced up into these small blocks, and each block is self-contained—the data to decode it is all in one contiguous chunk in memory. Moreover, <strong>the size of each compressed block is fixed—either 8 or 16 bytes</strong>, depending on which BCn format is being used. This represents a 4:1 or 8:1 compression ratio, if the source image is in 8-bit RGBA format.</p>
</blockquote>

<p>So as long as your pixel count does not change, the size of the texture does not change either. However, the more channels you use (only 3 and 4 are supported by BC7 according to <a href="https://docs.microsoft.com/en-us/windows/win32/direct3d11/bc7-format" rel="nofollow noreferrer">the Microsoft documentation</a>), the less information you can store per color channel in a block. This means, that you lose more information due to compression when using RGBA instead of RGB. </p>

CC BY-SA 4.0
2020-05-28T10:47:31.990Z
2020-05-28T10:56:06.910Z
2020-05-28T10:56:06.910Z
wychmaster
<p>BC7 always effectively encodes 4 channels. That's part of the nature of the format. Turning on alpha means that the compressor will read and use the alpha value in your source image, but that's all.</p>
<p>All BC7 compressed images of a given dimension have the same size, since BC7 compresses each 4x4 group of texels into 128-bits. But that doesn't mean they have the same <em>quality</em>.</p>
<p>BC7 is an adaptive encoding format. While each block has a fixed size (both spatially and bit-wise), each block stores how many channels that block actually compresses and the way that they correlate with one another. The <a href="https://www.khronos.org/registry/DataFormat/specs/1.3/dataformat.1.3.html#bptc_bc7" rel="nofollow noreferrer">specifics are complex</a>, but the general upside is that the compressor figures out on a per-block basis what manner of compression works best for a particular block. If the compressor can look at a block and see that the alpha for all texels is 1.0, then it can spend more bits of the 128 bits on the colors and fewer on the alpha.</p>
<p>As such, a texture &quot;without alpha&quot; is exactly like a texture with alpha where every texel has an alpha of 1. These blocks will spend the majority of their bits on the non-alpha parts of the texels, only wasting a few bits on a &quot;mode&quot; field that lets the decompressor know that the alpha is a constant 1.0.</p>
<p>This also means that, if your texture has a varying alpha, but parts of it have a constant alpha, BC7 can encode these constant alpha areas with fewer bits, so that more bits can be spent on improved color encoding.</p>
<p>So you shouldn't feel that there is a problem because the two compression switches came out with the same number of bytes.</p>

CC BY-SA 4.0
2020-05-28T17:50:55.903Z
2020-08-26T16:03:48.453Z
2020-08-26T16:03:48.453Z
Nicol Bolas
<p>So i've a made a texture. I've saved the RGB one with BC7 compression, then added alpha channel[specular map] with varying levels of grayscale, and saved the file again as RGBA with BC7 compression. The resulting file has the same size as the one without alpha, yet it contain additional information -alpha channel. How it is possible? You can't have cake and eat cake as i understand, so are there any compromises made to ensure same size? </p>

<p>Im using photoshop with intel DDS plugin. </p>

<texture>
BC7 texture with alpha has the same size as BC7 without alpha
Piotr Burzała
# BC7 texture with alpha has the same size as BC7 without alpha

(Asked by: username_0 on 2020-05-28)

So i've a made a texture. I've saved the RGB one with BC7 compression, then added alpha channel[specular map] with varying levels of grayscale, and saved the file again as RGBA with BC7 compression. The resulting file has the same size as the one without alpha, yet it contain additional information -alpha channel. How it is possible? You can't have cake and eat cake as i understand, so are there any compromises made to ensure same size?

Im using photoshop with intel DDS plugin.

**Tags:** texture


---

## 2 answers

### Answer by username_2 on 2020-05-28. Score: 4 | Accepted answer

BC7 always effectively encodes 4 channels. That's part of the nature of the format. Turning on alpha means that the compressor will read and use the alpha value in your source image, but that's all.

All BC7 compressed images of a given dimension have the same size, since BC7 compresses each 4x4 group of texels into 128-bits. But that doesn't mean they have the same *quality*.

BC7 is an adaptive encoding format. While each block has a fixed size (both spatially and bit-wise), each block stores how many channels that block actually compresses and the way that they correlate with one another. The [specifics are complex](https://www.khronos.org/registry/DataFormat/specs/1.3/dataformat.1.3.html#bptc_bc7), but the general upside is that the compressor figures out on a per-block basis what manner of compression works best for a particular block. If the compressor can look at a block and see that the alpha for all texels is 1.0, then it can spend more bits of the 128 bits on the colors and fewer on the alpha.

As such, a texture "without alpha" is exactly like a texture with alpha where every texel has an alpha of 1. These blocks will spend the majority of their bits on the non-alpha parts of the texels, only wasting a few bits on a "mode" field that lets the decompressor know that the alpha is a constant 1.0.

This also means that, if your texture has a varying alpha, but parts of it have a constant alpha, BC7 can encode these constant alpha areas with fewer bits, so that more bits can be spent on improved color encoding.

So you shouldn't feel that there is a problem because the two compression switches came out with the same number of bytes.


---

### Answer by username_1 on 2020-05-28. Score: 3

Here is an article about the BCn format: [click me](http://www.reedbeta.com/blog/understanding-bcn-texture-compression-formats/). It is written by Nathan Reed, who is quite active on this site. So he will probably pass by and might answer your question with more details, even though I think the article will explain everything you need to know.

The most relevant part for your question seems to be this section from the article:

> BC stands for “block compression”, and the BCn formats **all operate in terms of 4×4 blocks of pixels.** All images are sliced up into these small blocks, and each block is self-contained—the data to decode it is all in one contiguous chunk in memory. Moreover, **the size of each compressed block is fixed—either 8 or 16 bytes**, depending on which BCn format is being used. This represents a 4:1 or 8:1 compression ratio, if the source image is in 8-bit RGBA format.

So as long as your pixel count does not change, the size of the texture does not change either. However, the more channels you use (only 3 and 4 are supported by BC7 according to [the Microsoft documentation](https://docs.microsoft.com/en-us/windows/win32/direct3d11/bc7-format)), the less information you can store per color channel in a block. This means, that you lose more information due to compression when using RGBA instead of RGB.


---

