SVG Opacity: How Transparency Works in SVG Logos and Favicons
How SVG opacity works: opacity vs fill-opacity and stroke-opacity, how overlapping shapes behave, and what transparency means for SVG favicons and logo exports.
Contents
The short answer
In SVG, opacity controls how transparent an element is, on a scale from 0 (fully transparent) to 1 (fully opaque). SVG offers several opacity controls. The general opacity property affects an entire element or group. Fill-opacity, stroke-opacity, stop-opacity and flood-opacity each target one part of the drawing. A color with an alpha channel, such as an rgba() value or an eight-digit hex code, adds transparency to a single color. For a logo or favicon, the choice between these affects how overlapping shapes look, how the file exports to raster formats, and how the mark reads against light and dark browser tabs.
Scope note: no subject-specific evidence was supplied for this article, such as browser test results, tool versions or measured rendering differences. The explanations below rely on documented SVG and CSS behavior and general practice. They are not based on testing. Where browser or tool behavior varies, check it against current documentation and your target browsers.
The opacity controls available in SVG
| Control | What it affects | Typical use in logo artwork |
| opacity | The whole element or group, including fill, stroke and children, composited as one unit | Fading an entire mark or a grouped layer evenly |
| fill-opacity | Only the interior paint of a shape | Translucent shapes that keep a solid outline |
| stroke-opacity | Only the outline paint | Soft outlines over a solid fill |
| stop-opacity | A single color stop in a gradient | Gradients that fade to transparent |
| flood-opacity | The flood color in filter effects | Shadow or glow effects built with filters |
| Alpha in a color value (rgba or #RRGGBBAA) | That one color wherever it is used | Translucent color defined directly in the fill or stroke |
These controls can be written as presentation attributes on the element, such as opacity="0.5", or as CSS properties in a style attribute or stylesheet. The 0–1 number form has the widest support. Current CSS specifications also allow percentages, but older renderers and some design tools may not interpret them consistently.
How opacity differs from fill-opacity
The main practical difference shows up where shapes overlap.
- Opacity on a group renders the group's contents first and then makes the combined result transparent. Overlapping shapes inside the group do not show through each other, so the group fades as one flat silhouette.
- Opacity or fill-opacity on each shape makes every shape transparent on its own. Where two such shapes overlap, the overlap is denser than either shape alone, which produces visible darker or more saturated regions.
- When a shape has both a fill and a stroke, opacity on the shape fades both together. Fill-opacity fades only the fill, and the stroke stays at full strength.
<!-- Group opacity: the two circles fade as one silhouette -->
<g opacity="0.5">
<circle cx="12" cy="16" r="10" fill="#1a73e8"/>
<circle cx="20" cy="16" r="10" fill="#1a73e8"/>
</g>
<!-- Per-shape fill-opacity: the overlap appears darker -->
<circle cx="12" cy="16" r="10" fill="#1a73e8" fill-opacity="0.5"/>
<circle cx="20" cy="16" r="10" fill="#1a73e8" fill-opacity="0.5"/>
Inheritance also differs. Fill-opacity and stroke-opacity are inherited, so a value set on a group is passed to child shapes unless a child overrides it. Opacity is not inherited in that way. Instead it compounds: a child at 0.5 inside a group at 0.5 appears at roughly a quarter of full strength.
Why this matters for SVG favicons
A favicon is displayed very small and on backgrounds you do not control. Browser tabs, bookmark bars and dark or light system themes all change what sits behind the icon. Transparency in a favicon therefore needs more care than in a large logo.
- Low-opacity details tend to disappear at tab size. A shape that reads well at 0.3 on a large canvas can become nearly invisible at 16 or 32 pixels.
- Semi-transparent areas take on the color of whatever is behind them. A mark that looks right on a white tab can turn muddy on a dark one. An SVG favicon can include a prefers-color-scheme media query in an embedded style block to adjust colors for dark themes. Support for this inside favicons varies by browser, so test it.
- Fully transparent backgrounds are common and useful for favicons. Partially transparent backgrounds behind the whole mark usually add little and reduce contrast.
- SVG favicon support is not universal across browsers and platforms. A raster fallback, such as PNG or ICO, is common practice. Opacity in the SVG must survive that export accurately.
Opacity when exporting to PNG or ICO
Raster formats that carry an alpha channel, such as PNG and 32-bit ICO, can preserve partial transparency from the SVG. The fallback should look like the vector version as long as the export keeps the alpha channel. Exporting to a format without alpha, or exporting onto a solid background color, flattens the transparency against that color. That result only looks correct on matching backgrounds.
Design tools differ in how they write opacity into exported SVG code. Some keep layer opacity as group opacity. Others push it down to individual shapes, or convert it into colors with alpha. As shown above, these approaches can render overlaps differently. After exporting, inspect the SVG code or preview it in a browser to confirm the result matches the artwork.
Vector shapes, embedded images and previews
Opacity can be applied to any SVG element, including an embedded raster image placed with the image element. Applying opacity does not make that image vector artwork. It is still a bitmap with a fixed resolution. A file ending in .svg may contain only an embedded raster, or may itself be a preview rather than editable paths. Open the file and check whether the logo is built from paths and shapes before relying on it for opacity adjustments or favicon production.
If the logo belongs to someone else, permission to download the file is not the same as permission to change it. Altering its opacity or colors is a modification, and the artwork, any fonts and the trademark may each carry their own usage terms.
Practical guidance
- Use group opacity when a multi-part mark should fade evenly without visible overlaps.
- Use fill-opacity or stroke-opacity when only one part of a shape should be translucent.
- For favicons, prefer solid colors and clear contrast over subtle transparency, and preview the icon at actual tab size on both light and dark backgrounds.
- Export raster fallbacks with an alpha channel, and check that they match the SVG.
- Verify browser support for SVG favicons and dark-mode styling against current documentation, since this brief supplied no test data.