PNG vs SVG: Choosing Raster or Vector for Logos, Icons and Screenshots
Give scenario decisions around scaling, text, filters, transparency, security and browser delivery.
PNG vs SVG: Choosing Raster or Vector for Logos, Icons and Screenshots
You exported a logo at 600×600 px, and now it needs to go on a billboard. A screenshot looks soft on a high-DPI display. An icon set must work at 16×16 px in a browser tab and 256×256 px in an app launcher. These failures share one cause: the format choice did not match the delivery requirements.
PNG stores a fixed grid of pixel samples. SVG stores drawing instructions as XML text. Neither format is universally better. The decision turns on what the image contains, where it renders, and what information you can afford to lose.
How Enlargement Destroys PNG Detail
PNG records every pixel at a fixed resolution. When software enlarges a 100×100 px PNG to 1000×1000 px, it must interpolate the missing samples. The result is blurred edges, softened lines, and blocky gradients. SVG stores coordinates and curves. At any display size, the renderer redraws the shapes at the target device resolution.
Observable check: Take a PNG containing a 1 px stroke and scale it 4× in any image editor. View at 100 % zoom. The stroke appears jagged or softened. Open the same design as SVG in a browser and zoom to 400 %. The stroke remains crisp.
Hard limit: A raster logo exported at 72 DPI for a screen mockup cannot supply the pixel data needed for 300 DPI print. The only recovery path is returning to the source vector file and re-exporting at the correct resolution. The PNG specification defines pixel samples as fixed-bit-depth values with no mechanism for retaining the original vector geometry—only the final rendered color of each sample is stored.
Why Screenshot Text Blurs and SVG Text Does Not
Screenshots capture rendered text as pixels. When display resolution differs from capture resolution, the text must be resampled. A screenshot of 12 pt text captured at 96 DPI appears soft on a 144 DPI screen because the fixed pixels spread across more physical dots.
SVG handles text as text. The browser or operating system renders the typeface using the current display’s resolution and hinting tables. No resampling occurs.
Diagnostic step: Capture a webpage screenshot at 100 % browser zoom. View the PNG at 100 % zoom. Capture the same page at 200 % zoom. Compare the two—the anti-aliasing pattern changes between captures. For logos or icons containing text, use SVG when legibility must hold across devices. When PNG is required, export at 2× the target display dimensions to oversample.
Hard limit: PNG cannot embed font data. The glyphs are burned into the pixel grid, which means the screenshot displays correctly regardless of installed fonts—but the text cannot be edited without re-creating the image.
When PNG Preserves Effects That SVG May Alter
SVG supports CSS-style filters (blur, drop shadow, color matrix) computed live by the renderer. The same SVG can produce different visual results in different browsers or vector editors if filter implementations diverge. PNG bakes the effect into pixel data. Every viewer sees identical output.
When this matters: A complex Gaussian blur applied to a logo background. In SVG, the blur radius is a parameter interpreted by the viewer. If the rendering engine uses a different blur kernel, the softness changes. In PNG, the blur is rendered once and stored as flat pixels. The trade-off is that a blurred PNG cannot be re-sharpened.
Conversion warning: Converting an SVG with filters to PNG flattens the effect. The original blur radius, shadow offset, or color matrix coefficients cannot be recovered from the PNG pixels. The PNG specification’s filter byte controls row-by-row compression prediction, not visual effect preservation.
Transparency: Alpha Channel Behavior vs. Vector Opacity
Both formats support transparency, but the mechanisms differ. PNG uses an alpha channel (up to 8 bits per pixel, depending on bit depth). Each pixel holds one of 256 opacity levels. SVG applies an opacity attribute to shapes or groups and can also carry an alpha channel in embedded raster images.
Scenario decision: A favicon sitting on a colored toolbar works with PNG’s full alpha channel—the browser composites transparent pixels over the background. A logo overlaid on a gradient or video benefits from SVG, where vector edges remain crisp at any zoom level. PNG edges may show a faint halo if the original export background color differs from the destination background.
Observable check for halo: Place the transparent PNG over a solid black background, then over solid white. A colored fringe around the edges reveals anti-aliasing performed against the original background. The fix is exporting the PNG with a matte color matching the intended background, or using SVG, which anti-aliases dynamically against whatever background it is drawn on.
Security Properties: Chunk Metadata vs. Executable Code
PNG files can contain ancillary chunks storing text metadata (tEXt, zTXt, iTXt) and application-specific data. These chunks may hold EXIF-like information, color profiles, timestamps, or embedded thumbnails. SVG files are XML text and can include metadata, but their structure also permits executable content.
Security consideration: A PNG received from an external source may contain geolocation data in a text chunk or embedded software comments. SVG can contain <script> elements or event handler attributes that execute when the file opens in a browser. This is a risk SVG carries that PNG does not.
Inspection method: For PNG, use pngcheck -v (command-line) or a hex viewer to list all chunk types. Look for tEXt or iTXt chunks with keys such as “Software,” “Comment,” or “XML:com.adobe.” For SVG, open the file in a text editor and search for <script or onload=. The PNG chunk structure does not support executable code, making it the safer choice for sharing untrusted files.
Browser Delivery: File Size, Requests, and Rendering Cost
PNG compresses photographic content efficiently. The DEFLATE algorithm handles repetitive pixel patterns well, making PNG smaller than SVG for screenshots, gradients, and textures. SVG is smaller for simple geometric shapes and text because coordinate data is compact.
Delivery test: A 600×400 px screenshot at 24-bit color saved as PNG typically measures 200–400 KB. The same image exported as SVG, with every pixel represented as a rectangle, can reach tens of megabytes. A simple flat-color logo as SVG may be 2 KB; the same logo as a 2×resolution PNG may be 50 KB.
Browser rendering cost: PNG decodes once and uploads to the GPU as a texture. SVG must be parsed into a DOM and each shape rendered individually. A page with 100 icons as 100 separate PNGs generates 100 HTTP requests (or one sprite sheet) with fast rendering. The same icons as 100 inline SVGs generate one request but heavier DOM processing. The PNG specification defines Adam7 interlacing for progressive display, though many modern browsers disable it due to security concerns.
Hard limit: PNG cannot contain vector paths. If one image must serve as a 16×16 px favicon and a 512×512 px app icon, you must export two separate PNGs or use one SVG that scales without quality loss. SVG also supports CSS media queries and viewBox scaling, allowing a single file to adapt to different containers.
What Conversion Cannot Recover for PNG vs SVG
Converting SVG to PNG loses: - Scalability (output is a fixed pixel grid) - Editable text (glyphs become pixel patterns) - Filter parameters (blur radius, color matrix coefficients) - Layer structure (all shapes flatten into one bitmap)
Converting PNG to SVG via auto-tracing loses: - Exact pixel fidelity (tracing approximates shapes) - Photographic detail (gradients become banded fills) - Transparency precision (partial alpha is often quantized to fully opaque or fully transparent)
The PNG specification guarantees lossless storage of pixel data. But the pixel data itself is a lossy representation of any vector source. Once rasterized, the original geometry cannot be recovered.
Decision Matrix
| Scenario | Format | Reasoning |
|---|---|---|
| Responsive logo (fixed aspect ratio) | SVG | Scales to any viewport without re-export |
| Screenshot for documentation | PNG | Preserves exact appearance of the captured UI |
| Icon set for app toolbar (multiple sizes) | SVG | One file serves all sizes without interpolation |
| Favicon (16×16 px) | PNG | Minimal file size, no parsing overhead, universal browser support |
| Complex gradient or photo thumbnail | PNG | Compression outperforms SVG for continuous-tone images |
| Interactive infographic | SVG | Supports hover states, tooltips, and clickable links |
| Untrusted file from email | PNG | No JavaScript execution risk; metadata is inspectable |
For optimizing PNG delivery to modern browsers, see the PNG to WebP for Faster Websites guide. For multi-resolution icon workflows, the PNG to ICO page covers the multi-image container format.
Technical basis for PNG vs SVG
Structural claims in this guide are grounded in the primary PNG technical reference.