Process

Texture Compression on Mobile: ASTC, ETC2, and Picking Right

ASTC is the sensible default for most Android games today, but block size is where the real savings live. Here is how we pick formats per texture type, plus a script that sets it on import.

Vectra Play 5 min read
A close-up of a monitor comparing two versions of the same game texture side by side

For Unity texture compression on Android, ASTC is the sensible default today, with ETC2 as the fallback for older devices. The bigger decision is ASTC block size: small blocks such as 4x4 for UI and text, around 6x6 for most game art, and 8x8 or larger for backgrounds. Set it per texture type, ideally automatically on import.

Why texture format matters so much

Textures are usually the biggest chunk of a mobile build and of runtime memory. The wrong format can double your download size, push low-end phones into memory trouble and make UI text look smeared.

The good news is that this is one of the few performance wins you can get without touching game code. It sits next to the other fixes in our low-end Android performance guide.

Pick the format once at the project level, then spend your time on block size per texture. That is where the memory goes.

ASTC and ETC2 in plain terms

Both are formats the phone's graphics chip can read directly, so the texture stays compressed in memory. They differ in flexibility and support.

ASTCETC2
Quality per byteGenerally betterGood
Size optionsMany block sizes, from 4x4 to 12x12Fixed rates
Alpha supportYes, at the same block sizesYes, at a higher cost
Device supportMost modern Android phones and iPhonesRequired by OpenGL ES 3.0, very wide
Crunch compressionNot supportedSupported

Block size is the key ASTC idea. Every block of pixels takes the same number of bytes, so a larger block spreads those bytes over more pixels. A 4x4 block works out to 8 bits per pixel, 6x6 to about 3.56, and 8x8 to 2.

Where to set it in Unity

There are two levels: the project default and the per-texture override.

Project default

In recent Unity versions, the Android default lives under Edit > Project Settings > Player > Android > Other Settings > Texture Compression Formats. Older versions put a single Texture Compression dropdown in File > Build Settings with Android selected. Menu paths move between versions, so check your own editor.

If you list more than one format and build an Android App Bundle, Google Play can deliver the right one per device. That keeps ASTC for modern phones and ETC2 for older ones without doubling every download.

Per-texture override

Select a texture, open the Android tab in the Inspector, tick Override for Android, and pick a format and block size. This is where the real savings come from.

Block size by texture type

These are starting points we use. Always check the result on a real device at real screen size.

Pixel art is the exception. Use uncompressed or a high-quality setting with point filtering, because block artefacts break the crisp pixels.

Setting it automatically on import

Clicking through hundreds of textures is slow and easy to get wrong. An AssetPostprocessor can apply sensible defaults the first time a texture is imported, based on its folder.

using UnityEditor;

public class AndroidTextureDefaults : AssetPostprocessor
{
    void OnPreprocessTexture()
    {
        // Only on first import, so manual tweaks are kept.
        if (!assetImporter.importSettingsMissing) return;

        var importer = (TextureImporter)assetImporter;
        var s = importer.GetPlatformTextureSettings("Android");
        s.overridden = true;

        if (assetPath.Contains("/UI/"))
            s.format = TextureImporterFormat.ASTC_4x4;
        else if (assetPath.Contains("/Backgrounds/"))
            s.format = TextureImporterFormat.ASTC_8x8;
        else
            s.format = TextureImporterFormat.ASTC_6x6;

        importer.SetPlatformTextureSettings(s);
    }
}

Put it in an Editor folder. The importSettingsMissing check means it only fires on new textures, so your hand-tuned overrides survive a reimport.

Checking the result

Do not trust the editor preview alone. Check three things after a change.

  1. Build size. The Editor log after a build lists the largest assets. Watch textures move down that list.
  2. Memory. Use the Memory Profiler package on a device to see texture memory before and after.
  3. Looks. Put the old and new builds side by side on the same phone and check UI, gradients and faces.

Gradients and soft shadows show banding first. If they look rough, go one block size smaller for just those textures. Our post on cutting Unity build size has more on reading the build report.

What we would do

We would set ASTC as the project default, add ETC2 as a second format if the game targets older devices, and ship as an App Bundle. Then we would drop the import script into the project on day one, before the art pipeline gets going.

After that, the only manual work is checking the handful of textures that look wrong. That is a far better use of an afternoon than clicking through every file.

The short version

If your build is heavy and you want another pair of eyes on the texture setup, give us a shout.

Related reading: Cut Your Unity Build Size in Half Without Losing Art Quality, Unity Mobile Performance: 12 Fixes That Buy You 20 FPS on Low-End Android, Shipping on Android: The Device Fragmentation Survival Guide

#Unity#Android#Art#Mobile#Tools
Your turn

Got a game idea? We build it.

You bring the concept. We design, build, test and launch it, and you own 100% of the finished game.

Share Your Game Idea  →