For most web game images, PNG or JPG wins on raw performance, and SVG wins only for interface icons and simple flat shapes. SVG is vector markup that the browser must parse and rasterize every frame it changes; PNG and JPG are pre-rasterized bitmaps the GPU can upload and draw directly. Choose per asset, not per project.
The short answer hides the real mechanism, though. A format is only "faster" relative to how the image is used: decoded once into GPU memory, scaled at runtime, redrawn every frame, or generated dynamically. This explainer breaks down where each format's cost actually lands, with numbers you can act on.
What each format actually costs the browser
Every image a game draws passes through the same pipeline: fetch bytes over the network, decode them into pixels, upload to GPU memory, then draw. The formats differ in where the cost concentrates.
PNG is lossless bitmap compression. Its DEFLATE stage is cheap to decode relative to what comes next, but lossless data means large files for photographic or gradient-heavy art. A 1024×1024 photographic PNG can run 1–2 MB where the same image as JPG is 80–150 KB. PNG's strength is exact pixels: crisp edges, flat color, transparency with a clean alpha channel, no generation loss on re-save.
JPG is lossy DCT compression. Files are small, decode is fast, but there is no alpha channel and hard edges smear into ringing artifacts. It is built for continuous-tone imagery, not sprite sheets or pixel art.
SVG is not an image at all in the bitmap sense. It is XML describing shapes, paths, and gradients. The browser parses the markup, builds a render tree, then rasterizes it at the display size. That rasterization cost recurs whenever the SVG changes or is re-rendered at a new scale. A complex SVG with hundreds of paths can cost more CPU per frame than a modest PNG. Simple SVG icons cost almost nothing.
The practical consequence: SVG's cost is paid at render time and scales with path complexity; PNG and JPG costs are paid mostly at load and scale with file size. That single distinction drives almost every decision below.
Quantified performance context
File size differences are large and predictable. For a 512×512 asset: a flat-color icon as PNG might be 8–20 KB, as SVG 2–6 KB, as JPG 15–30 KB with visible edge artifacts. A photographic texture at the same size: PNG 300–600 KB, JPG 40–90 KB, SVG impractical because it would embed a bitmap anyway or balloon into megabytes of path data.
Decode times matter at scale. Browsers decode PNG and JPG off the main thread in modern engines, typically in single-digit to low-tens of milliseconds for sub-megapixel images. A sprite atlas of 2048×2048 as PNG might decode in roughly 10–40 ms depending on hardware. SVG rasterization of a complex scene can exceed that and, critically, may happen on the main thread during layout, producing jank.
Memory is the sleeper cost. A decoded bitmap occupies width × height × 4 bytes in GPU memory regardless of file format. A 2048×2048 atlas consumes about 16 MB decoded whether it arrived as a 400 KB JPG or a 3 MB PNG. Compression saves bandwidth, not VRAM. This is the detail most thin explainers miss: your GPU budget is set by pixel dimensions, not file format.
Format comparison at a glance
| Format | Compression | Alpha | Scales cleanly | Decode/raster cost | Best asset type |
|---|---|---|---|---|---|
| PNG | Lossless | Yes | No | Low–moderate | Sprites, UI, pixel art |
| JPG | Lossy | No | No | Low | Backgrounds, photos |
| SVG | Vector/text | Yes | Yes | Low (simple) to high (complex) | Icons, HUD, flat shapes |
| WebP | Lossy or lossless | Yes | No | Low | General bitmap replacement |
| AVIF | Lossy or lossless | Yes | No | Moderate | Modern bitmap, small files |
The table reflects stable format properties, not benchmarked rankings, which vary by engine and hardware.
Edge cases where the default flips
Retina and variable-density displays are where SVG earns its place. A UI icon exported as a 32×32 PNG looks soft on a 2× display and forces you to ship 1×, 2×, and 3× variants. One SVG serves all densities with no resampling blur. For a game HUD with dozens of icons, that cuts asset count and eliminates a whole class of scaling bugs.
Animated content changes the calculus entirely. SVG animation (SMIL or CSS) can be cheap for a few elements but expensive when many nodes animate each frame. Sprite-sheet animation in PNG is usually cheaper per frame because the GPU just samples a different region. For particle effects and heavy motion, bitmaps in an atlas beat SVG decisively.
Pixel art is a hard rule. Scaling pixel art with SVG or with any smooth filtering destroys the aesthetic; you must use nearest-neighbor sampling on a bitmap, typically PNG, to keep crisp pixels. JPG is disqualified because lossy compression corrupts exact pixel colors.
Generating images at runtime is another flip. If your game draws procedural shapes, charts, or player-authored content, SVG or canvas vector drawing avoids shipping assets at all. Pre-rendered bitmaps cannot adapt to arbitrary data without a server or heavy client work.
Common misconceptions, corrected
"SVG is always smaller and therefore always faster." Small files help network load, but SVG's render cost can dominate for complex art, and a big SVG can lose to a modest PNG on total time. "JPG is fine for everything photographic." Correct for full-screen backdrops, wrong for anything with transparency or hard edges, which JPG cannot represent without artifacts. "File size equals memory use." It does not. Decoded VRAM scales with pixel dimensions, so a tiny JPG of a huge image can still blow your GPU budget. "One format should win across the whole game." A single mixed pipeline (SVG icons, PNG sprites, JPG backgrounds) routinely beats forcing one format everywhere. "Higher resolution always looks better." On low-end mobile GPUs, oversized textures cause memory pressure and eviction, which harms frame rate more than a slightly softer asset.
The counterintuitive professional caveat: optimizing file size can make a game slower. Aggressively compressed textures that decode to full resolution still consume full VRAM, and adding many small images (even tiny SVGs) increases draw calls and texture binds. Batching into atlases often matters more than format choice.
Practical actions and thresholds
Start by classifying assets. Ask whether each image needs transparency, exact pixels, or arbitrary scaling.
Icons, HUD elements, and flat logos: use SVG, and simplify paths to keep node counts low. Sprites, pixel art, and anything needing alpha: use PNG, packed into atlases. Full-screen photographic backgrounds and textures without alpha: use JPG, or WebP/AVIF where supported for smaller files. Animated sequences: use PNG sprite sheets in an atlas, not SVG animation, for high frame counts. Procedural or data-driven visuals: draw with canvas or SVG at runtime instead of shipping bitmaps.
Apply concrete thresholds. Keep individual bitmap textures at or below 2048×2048 on mobile to stay within common GPU limits and avoid eviction. Atlas related sprites so a scene uses a handful of texture binds rather than dozens. Target total decoded texture memory under roughly 100–150 MB for mid-range mobile, and measure rather than guess. Convert PNG photographs to JPG or WebP when the source has no alpha and no hard edges; expect 60–90% size reduction. Keep SVGs under a few hundred path nodes; above that, compare rasterized PNG output on your target devices.
Reconciling thresholds: the "use SVG for icons" and "keep SVGs simple" rules are the same rule seen from two sides. SVG wins when path complexity is low and scaling or transparency matters; it loses when either condition fails. The "smaller files are faster" and "VRAM is set by dimensions" rules reconcile through measurement: file size governs load time, dimensions govern runtime memory, and both must be checked.
Always test on your lowest-spec target device with the browser's performance tools. Format theory predicts direction; profiling tells you magnitude. A format swap that saves 200 KB may be invisible if load is dominated by a 5 MB bundle, and an SVG that looks tiny may cause frame drops if it re-rasterizes during animation.
Limitations and what this cannot settle
Format performance depends on the rendering engine, device GPU, texture compression support, and how the engine batches draws, so no single ranking holds universally. WebP and AVIF support and decode cost vary by browser and hardware, and their advantages are not guaranteed on older devices. Engine-level texture compression formats (like GPU-native compressed textures) can outperform all the formats discussed here for large 3D assets, and that is a separate pipeline decision. Benchmarks are hardware-specific and age quickly, so treat any specific millisecond figure as illustrative. This article explains stable mechanisms and directional guidance; it does not substitute for profiling your own build on your own target devices, and it offers no guarantee of frame-rate or load-time outcomes.