Mobile Development 8 min read

Texture Compression Technique for Mobile Effects: Removing Hollow Areas to Reduce Memory Usage

This article presents a texture compression method that eliminates hollow (alpha‑zero) regions by reorganizing textures into macro‑blocks, storing index maps for reconstruction, and demonstrates significant memory savings and unchanged visual quality on mobile devices, even after video encoding.

Kuaishou Tech
Kuaishou Tech
Kuaishou Tech
Texture Compression Technique for Mobile Effects: Removing Hollow Areas to Reduce Memory Usage

When rendering special effects on mobile devices, large numbers of sequence‑frame textures with hollow (alpha‑zero) areas consume excessive memory. The proposed texture compression method removes these hollow regions during texture preparation by partitioning the source image into macro‑blocks, relocating only the effective blocks into a smaller texture, and recording their new positions in an index map.

The overall process consists of two steps: Texture Compression – identify macro‑blocks with non‑zero alpha, pack them into a compact texture, and generate an index texture (R channel for X, G channel for Y); Texture Restoration – during rendering, read the index texture to locate the correct macro‑block in the compressed texture and sample the appropriate color.

Key implementation details include selecting an appropriate macro‑block size (e.g., 32×32 for a 1024×1024 source), adding edge padding to avoid sampling artifacts caused by bilinear interpolation, and storing additional block position data in the index texture’s B and A channels to bypass precision errors.

The method is compatible with video codecs such as H.264; experiments show that with internal edge padding the visual quality after encoding remains comparable to the original.

Application on a short‑video effect (a multi‑colored butterfly sticker) demonstrated that the compressed textures reduced memory usage from ~585 MB to ~527 MB on an iPhone SE 2, saving over 50 % of memory while maintaining 30 FPS performance and visual fidelity.

In summary, the technique effectively removes hollow texture regions, achieves near‑lossless visual results, and offers substantial memory optimization for mobile graphics pipelines, though it introduces additional preprocessing steps that could be further automated.

Memory Optimizationtexture compressionShaderVideo Effectsmobile graphics
Kuaishou Tech
Written by

Kuaishou Tech

Official Kuaishou tech account, providing real-time updates on the latest Kuaishou technology practices.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.