Raster vs Vector
See how pixels and geometry behave when enlarged or edited, using a reproducible 32-pixel PNG and an authored SVG circle.
Quick Summary
- Enlarging raster samples and drawing vector geometry again are different operations.
- A controlled PNG/SVG circle comparison makes scaling and radius edits reproducible.
- SVG can contain raster images; tracing does not guarantee meaningful editable objects.
- Category
- Conversion
- Difficulty
- Beginner
- Reading Time
- 5 min
- Related Tool
- Image to SVG
- Best For
- Format decisions, Beginners, Web assets
- Avoid For
- Format hype, One-size-fits-all rules, Photo replacement
Introduction
A raster image stores a grid of sampled colors. A vector graphic describes geometry that the browser draws at the requested size. The practical difference is what survives a change: do you enlarge existing samples, or render the shape again?
This guide uses one controlled circle to separate scaling from tracing. It does not measure a converter's accuracy. Image to SVG covers the conversion workflow; When NOT to use SVG covers rejecting an unsuitable result.
The same geometry, two representations
The SVG below defines a circle by its center and radius. SVGKIT created this teaching asset directly, then rendered it to a 32 by 32 PNG using Chromium canvas. The PNG is not a screenshot of a photograph and the SVG is not a trace of the PNG.
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256"><circle cx="144" cy="144" r="85" fill="#e74c3c"/></svg>One circle, sampled pixels versus geometry
Both views show the same authored geometry. Enlarge the 32-pixel PNG and the SVG to the same size to inspect the boundary. The PNG has a fixed set of samples; the SVG circle is drawn again at the target resolution.

- Raster dimensions
- 32 x 32
- Vector circles
- 1
Open the 32-pixel PNG, authored SVG, and measurement record. The controlled export is 695 bytes and the SVG is 143 bytes in the recorded Chromium run. These sizes describe only these files, not a ranking of PNG and SVG encoders. The script and browser version are recorded for reproduction.
Reproduce the scaling difference
Put the two downloaded files next to an HTML page and render them with equal dimensions:
<img src="circle-raster-32.png" width="256" height="256" alt="Enlarged raster circle">
<img src="circle-authored.svg" width="256" height="256" alt="Vector circle">First change both widths and heights to 32, then to 256. At 256 CSS pixels on a device-pixel-ratio-1 display, each raster sample spans eight display pixels per axis before interpolation. The browser can smooth that enlargement, but cannot recover a more precise source boundary. The SVG instead rasterizes its circle at the target resolution. Both ultimately become pixels on screen.
This deliberately small input makes the distinction visible. A suitably sized high-resolution PNG can look just as sharp at its intended size. Browser interpolation and device pixel ratio also affect appearance; “vector” does not mean that antialiasing or small-size alignment stops mattering.
Reproduce the editing difference
In the SVG, change only r="85" to r="64". The center stays at (144, 144) while the radius decreases. Change fill="#e74c3c" to fill="#167544" to recolor the whole circle.
The exported PNG has no radius or fill attribute. A bitmap editor can repaint pixels, but the original parameters are no longer explicit. Tracing that PNG may produce several paths around its antialiased boundary rather than recovering one editable circle.
| Operation | Raster export | Authored vector |
|---|---|---|
| Enlarge the example | Interpolate 32 x 32 existing samples | Rasterize the circle at the new size |
| Change the radius | Edit pixels or return to the source | Change r |
| Change the circle color | Select and repaint pixels | Change fill |
| Preserve a photograph's texture | Store its sampled detail | Requires another representation, often an embedded image |
Common mistakes
Assuming an SVG file contains only vector shapes
SVG can include a raster image through an image element. That embedded picture still has a fixed pixel resolution. Wrapping a PNG in SVG does not vectorize its contents. See the SVG image element.
Confusing a trace with editable source artwork
A trace stores geometry, but its paths may describe edge fragments rather than intended objects. Being able to edit coordinates is different from having meaningful circles, layers, text, or constraints.
Expecting vector text to stay searchable after tracing
Letter outlines are shapes, not text characters. For selectable text, retain actual text in the appropriate document or HTML structure instead of tracing a screenshot.
Best practices
- Keep the editable source and the delivery export as separate assets.
- Test the largest required display size, not only the fitted preview.
- Inspect whether an SVG uses shapes, embedded images, or both.
- Choose an editing workflow based on the objects you need to change later.
Practical workflow
- 1Identify which dimensions or properties the asset must support.
- 2Inspect the source: pixel samples, explicit geometry, or a mixture.
- 3Render raster and vector candidates at equal sizes.
- 4Try one real edit, such as changing radius or color.
- 5Keep the representation that supports the required appearance and edits.
FAQ
Does vector graphics mean no pixels are involved?
No. The browser ultimately draws pixels on a screen. Vector geometry allows it to calculate those pixels for the requested resolution instead of only enlarging a fixed source grid.
Can a high-resolution PNG look as sharp as SVG?
Yes, at sizes for which it has enough source pixels. The example intentionally uses a 32-pixel export to make enlargement limits visible.
Does tracing recover the original circle radius?
Not reliably. It estimates geometry from samples. The authored example has a known radius because we defined it before creating the PNG.
Want to inspect what tracing preserves?
Try a simple raster asset, then inspect whether the downloaded SVG contains the objects you would need to edit.
Try Image to SVG