Texture Compression

Texture compression is image compression applied to textures specifically.

A game's textures can take up a large part of memory, in RAM as well as in VRAM. For example, a texture image of 2048 x 2048 pixels that contains all four channels (R, G, B and A) takes up (2048 x 2048) pixels x 4 channels/pixel x 1 bytes/channel = 16777216 bytes, or 16MB of video memory. All this data needs to be loaded into RAM and then sent to VRAM.

Textures can be compressed to reduce their size, which minimises the amount of data that needs to be moved from RAM memory to VRAM when textures are prefetched (as the available "bandwidth" is limited). Additionally, if your game does many texture lookups and the platform it's running on does not have sufficient graphics memory bandwidth to handle the texture reading at a high frame rate, the game may slow down.

GameMaker has two ways to allow for texture compression and decompression. Texture compression is set per texture group and works differently according to the format used: 

The following image shows a comparison of different texture formats: 

A comparison of different texture group formats.
From left to right: BZ2 + QOI (no GPU texture compression), BC7 and BC3.

GPU Compressed Textures

The textures are stored in a compressed format in VRAM and are decompressed in real time by the GPU.

Custom GPU texture compression is done using an extension: GM-GPUTextureCompression. To generate GPU textures, you should first add this extension to your project.

After adding the extension, to enable GPU compressed textures for a texture group: 

When the game is compiled, the textures are generated by the external tool, which is executed through the extension. The tool compresses the textures to a format optimised for decompressing on the GPU.

For full information on the available texture formats that are supported, see the wiki.

WARNING Certain texture formats are only supported on certain platforms. You should make sure to select an appropriate one for the platform that you're compiling to. An error message is shown in The Output Window if the extension isn't present or any of the settings is incorrect.

GPU compressed textures are compressed using block compression. This is the most common form of GPU compression and is supported in some format on almost all modern platforms. When the GPU texture is generated from the original image using e.g. BCN compression, it is subdivided into fixed-size blocks of 4x4 pixels or texels (other compression algorithms support different block sizes). The information in the pixels in this block is converted to a 128 bit value. When the GPU reads back this value, it restores the colour value of the requested pixel from it as precisely as possible. See S3_Texture_Compression for more information.