Image Compression for Games: File Size, VRAM, and Major Engines
How PNG/JPEG/WebP relate to GPU memory, when to compress in a tool vs in Unity, Godot, or Unreal, and a practical pipeline that avoids double compression and ugly artifacts.
Image compression sounds like one problem—make files smaller—but in games you actually care about three things at once: how big the file is on disk or over the network, how much video memory (VRAM) the GPU needs once the texture is uploaded, and whether artifacts are acceptable for your art style. This post connects those ideas, compares how major engines treat imported textures, and outlines a workflow that avoids the classic mistake of compressing twice.
File Size Is Not the Same as VRAM
A 2 MB JPEG on disk might expand to several megabytes of VRAM after decoding and GPU upload, depending on format and mipmaps. Conversely, a "lossless" PNG can be small on disk but still become a large uncompressed or block-compressed texture in memory. When you budget for mobile or Switch-class hardware, plan for runtime memory and bandwidth, not just the download size of your asset bundle.
Lossless formats (PNG, lossless WebP) preserve pixels exactly; they are ideal for UI, pixel art source files, and anything that must stay crisp. Lossy formats (JPEG, lossy WebP) throw away detail to shrink byte size; they are common for photo-like backgrounds but can introduce blocking and color shifts that look bad next to clean game art. GPU block compression (BC/ASTC/etc.) is yet another step: the engine often transcodes your imported image into a format the GPU can sample efficiently—that affects VRAM and quality, and is configured per platform in the importer.
A Simple Mental Model: Three Stops on the Pipeline
Think of every texture as moving through three stages:
- Authoring / export — what leaves Photoshop, Blender, or Aseprite (often PNG or TGA).
- Distribution — optional extra compression for repos, downloads, or web tools (e.g. shrinking PNGs before commit, or using our Image Compressor for batch delivery).
- Engine import — the engine reads your file, may generate mipmaps, and stores GPU-ready data according to platform presets.
The infographic above shows how "small on disk" and "efficient on GPU" relate. Your goal is to pick one place to apply aggressive lossy compression for color data, and avoid stacking quality loss in multiple stages without noticing.
Unity: Importer Settings Dominate Runtime Cost
In Unity, the Texture Importer controls compression format, mipmaps, max size, and sRGB. For most color textures you want sRGB enabled; for normal maps and data textures you typically disable it. "Compression" in the Inspector maps to platform-specific GPU formats (ASTC on many mobile targets, BC on desktop, etc.).
Practical tips:
- Sprite sheets and UI: Use appropriate Sprite Mode and packing; compression still applies to the imported texture—verify quality on device, not only in the editor.
- Pixel art: Point filtering and disabling unnecessary downsampling preserves crisp pixels; compression artifacts may still appear if the format is too aggressive for low-res art.
- Avoid double loss: Heavily JPEG-compressed source art, then aggressive ASTC in the importer, can compound into muddy results. Prefer clean PNG sources for hand-painted assets, then let Unity's importer handle GPU compression once.
Godot 4: Import Defaults and Reimport
Godot applies import settings per asset; changing compression or mipmaps requires a reimport. See Importing images in the official docs. Mobile and desktop export templates may benefit from different compression—Godot's project settings and the import dock are where you align texture formats with your target hardware.
- 2D games: Large atlases benefit from mipmaps only when scaling or 3D mixed pipelines need them; pure 2D pixel games sometimes disable mips to save memory.
- VRAM: Godot shows useful import metadata in the inspector; use it to catch unexpectedly large textures before shipping.
Unreal Engine: Texture Groups and Cook Rules
Unreal's texture workflow centers on content types (world, UI, character, etc.) and cook rules per platform. Compression and size caps are often driven by texture group defaults and platform ini settings. For a high-level overview, see Epic's documentation on textures in Unreal Engine.
Teams often establish a clear policy: e.g. "base color 1024 max on mobile NPCs," "UI atlases uncompressed or BC7 on console," so artists know the bounds before authoring. Compression here is as much pipeline discipline as technical toggles.
Web Games (Phaser, PixiJS, Canvas)
In the browser, decoded image bitmaps still consume GPU memory once uploaded to WebGL. Large PNGs and JPEGs download quickly with gzip, but the decoded pixel buffer can be large; many WebP decoders produce raw RGBA before upload. Fewer unique textures and smaller dimensions directly improve performance on low-end laptops and phones.
- Prefer texture atlases to reduce bind and draw overhead (similar rationale to native engines).
- Precompressed delivery (e.g. smaller PNG/WebP from a tool) reduces CDN bytes; still test total memory after decode.
When to Use a Standalone Image Compressor
A browser-based Image Compressor fits when you need to shrink files before they enter source control, email, or a shared drive—without opening an editor. It is complementary to engine import settings, not a replacement: you still want a clean source if Unity or Godot will recompress for the GPU.
- Good fit: Batch reducing PNG/JPEG/WebP weight for builds, prototypes, or web-hosted asset packs.
- Watch out: Don't chase file size by crushing JPEG quality on textures that will later be recompressed aggressively in-engine—inspect both stages.
Common Pitfalls
- Double compression: Lossy source + lossy GPU format without visual checks.
- Ignoring color space: sRGB vs linear mismatches make "compressed" textures look washed or crunchy.
- Skipping mips when you need them: 3D or scaled 2D can shimmer; mips cost memory but fix sampling.
- Oversized authoring resolution: A 4K texture scaled down in-engine still costs more to import and store than authoring at the target resolution.
ASCII Reference: One-Line Pipeline
Author PNG ──► (optional) web / batch compress ──► Engine import ──► GPU format + mips ──► Draw
Summary
Game image compression is about balancing disk or network size, visual quality, and VRAM / format choices in your engine. Unity, Godot, and Unreal each expose import settings that matter more for runtime than any single JPEG quality slider in export. Use standalone compression when it helps your pipeline deliver smaller sources; avoid stacking lossy steps without reviewing the result on target hardware. When in doubt, keep a lossless master and derive compressed variants with clear naming and documented settings.