Contents
  1. What stroke-opacity does
  2. How it differs from opacity, fill-opacity and RGBA colors
  3. Why translucent strokes are risky in a favicon
  4. What happens when you convert to PNG or ICO
  5. Checking whether a logo file actually uses vector strokes
  6. Permission to modify a logo
  7. Gaps in this overview

In SVG, stroke-opacity controls how transparent an element's outline is, without affecting its fill. It takes a number from 0 (fully transparent) to 1 (fully opaque), and the default is 1. Modern renderers also accept percentages. For favicons, the property works the same way as in any SVG. The practical questions are how a semi-transparent outline behaves at very small sizes, against changing tab backgrounds, and after conversion to raster fallback formats.

What stroke-opacity does

Every SVG shape can have two paint layers: a fill for its interior and a stroke along its outline. The stroke-opacity property sets the transparency of the stroke layer only. You can write it as a presentation attribute on the element, inside a style attribute, or in a CSS rule. A value of 0.5 lets roughly half of whatever is underneath show through the outline.

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
  <circle cx="16" cy="16" r="12"
          fill="#1a73e8"
          stroke="#0b3d91"
          stroke-width="4"
          stroke-opacity="0.5"/>
</svg>

How it differs from opacity, fill-opacity and RGBA colors

Approach | What it affects | Practical behavior
stroke-opacity | The stroke only | The fill stays opaque. Where the stroke overlaps the fill, the fill shows through the stroke.
fill-opacity | The fill only | The outline stays opaque while the interior becomes translucent.
opacity | The whole element or group | The element is rendered first and then made transparent as a unit, so its own stroke and fill do not show through each other.
Color with alpha (rgba, hsla or 8-digit hex) in the stroke value | The stroke only | The visual result is similar to stroke-opacity, but some older or simpler SVG processors may not parse alpha color syntax.

The key difference is overlap. An SVG stroke is centered on the path, so half its width sits over the shape's own fill. With stroke-opacity, that inner half blends with the fill and the outer half blends with the background. The outline can then look two-toned. If you want one even level of transparency for the whole mark, apply opacity to the element or group instead.

Overlaps also behave differently depending on how the artwork is built. When a single path's stroke crosses itself, it is painted once, so the crossing does not get darker. When separate elements overlap, each translucent stroke is composited on its own, and the overlapping area does get darker. Logo files built from many separate segments can therefore look patchy where the segments meet.

Why translucent strokes are risky in a favicon

  • Size: a favicon is often displayed at very small pixel dimensions, and the stroke width scales down with the viewBox. A thin, semi-transparent outline can blur into anti-aliasing and almost disappear.
  • Background: browser tabs, bookmark bars and operating system surfaces vary in color, including light and dark themes. A translucent stroke picks up whatever is behind it, so its apparent color changes from one context to the next.
  • Contrast: lowering stroke opacity lowers contrast against both the fill and the background, and contrast is already scarce at favicon sizes.
  • Editorial judgment: for most favicons, a solid stroke in a chosen tint is more predictable than a translucent one. Reserve stroke-opacity for cases where the see-through effect is part of the brand mark.

If the effect has to adapt to light and dark interfaces, an SVG favicon can include a prefers-color-scheme media query in an embedded style block. Only some browsers honor that query inside favicons, and browser support for SVG favicons in general varies. Plan for a raster fallback either way.

What happens when you convert to PNG or ICO

Fallback favicons are usually raster PNG or ICO files. When an SVG is rasterized, stroke opacity is baked into each pixel's alpha channel, and the output stays transparent only if it keeps an alpha channel. Exporting to a format or bit depth without alpha flattens the translucent stroke onto a solid background color. Rasterizers also differ in how faithfully they handle presentation attributes, CSS styles and alpha color syntax. Check each exported size visually instead of assuming it matches the SVG.

Checking whether a logo file actually uses vector strokes

An .svg extension does not guarantee editable vector paths. Some SVG files only wrap an embedded raster image, typically in an image element with linked or base64-encoded pixel data. Stroke-opacity has no effect on those pixels. Some files contain strokes that have been converted to filled outlines; in that case the outline's transparency is controlled by fill-opacity or opacity. Before adjusting stroke transparency, open the file in a vector editor or text editor and confirm that the outline really is a path with a stroke attribute.

Design tools can also differ in where they write transparency on export. It might be a stroke-opacity attribute, a value inside a style attribute, an alpha color, or group opacity. Reading the exported markup tells you which one you are working with and whether the result will behave as described above.

Being able to download or open a logo's SVG does not mean you are allowed to change it. Altering stroke opacity on someone else's mark modifies the artwork, and the artwork, any typefaces in it and the trademark itself may each come with separate usage terms. For third-party logos, follow the owner's brand guidelines or get permission before you publish an altered version, including as a favicon.

Gaps in this overview

This article relies on general SVG principles. It does not include version-specific browser support data, rendering test results or tool-by-tool export behavior. Check current browser documentation and test your favicon in the browsers and themes your audience uses before relying on translucent strokes.