A two-unit stroke in a 64-unit mark becomes half a pixel at 16 pixels. An optimizer can remove bytes but cannot choose which strokes need redrawing. Keep the editable master and prepare a simplified small-size variant.
Procedure
-
Check that the root viewBox encloses strokes and shadows. Compare the original and optimized files on light and dark surfaces. For gradients and clips, verify that each url(#id) reference still resolves.
-
Keep an SVG for modern tabs. Rasterize transparent 16-, 32- and 48-pixel versions and package them into a multi-resolution ICO. Export a separate 180-pixel touch icon and 192- and 512-pixel PNGs for the web app manifest.
-
Declare the SVG icon, ICO fallback and apple-touch-icon in HTML. Use actual paths, sizes and MIME types in the manifest. For a separate maskable icon, keep the recognizable mark inside the central safe area and extend an opaque background to the edges.
Choosing an approach
| Surface | Delivery | Acceptance test |
|---|---|---|
| Browser tab | SVG and multi-size ICO | Legible at 16 pixels |
| iOS home screen | 180 × 180 PNG | Rounded cropping |
| Web app manifest | 192 and 512 PNG | Purpose and masking |
Check the result
Inspect a real tab at normal display scale, then add the site to a device home screen. If the old mark persists, version the asset filename and inspect the document’s network requests. Replacing the bytes at an old URL can leave a cached icon in view.
For third-party shapes in the master, create an icon license manifest first.
Frequently asked questions
Should I remove the viewBox to save bytes?
It defines the scalable coordinate system. Test multiple output dimensions for distortion and clipping before considering removal.
Can a single 512-pixel PNG do every job?
It can be a source, but downsampling may erase the mark at 16 pixels. Inspect the smallest rendition and simplify its interior if needed.
References
Related reading
- Choose SVG icons for a SaaS website: license, stroke and accessible names
- Batch-compress WebP screenshots and add a mockup frame locally