.svg image blurry at specific zoom levels in Chrome .svg image blurry at specific zoom levels in Chrome google-chrome google-chrome

.svg image blurry at specific zoom levels in Chrome


The reason is that you use percentage to set the width of element the logo is in (parent element)

This means the logo is first rasterized from vector to an internal bitmap that is 100% of the size you set for the image. Then in your #header css rule you are using 80% for the header element which the image is inside.

What happens is that the internal bitmap the browser use to hold the rasterized vector image is scaled from 100% to 80% instead of re-rasterizing the vector. As this involves interpolation it will result in some blurry edges. This is a performance choice made by the browsers for parent's content.

The solution is to remove the 80% scaling of the header (parent) element. You can add a new rule and set the image width like this (you can of course use percentage instead - as long as the parent element isn't scaled this won't be an issue) - f.ex:

#header {    margin: 0 auto;    padding: 0;    text-align: center;    /*width: 80%;*/}.header-img {    width:200px;    height:auto;    }

Then in your html-code:

<img class="header-img" src="logo.svg" alt="" />

(you could have set #header img {...} but this has a performance penalty).

Here is proof-of-concept (a small difference 100 to 80%, but visible - compare the last part):

Using 100% rasterized bitmap for logo size scaled by browser to 80%:

enter image description here

Removing 80% from header (parent) element and for sake of example setting image width to 200px:

enter image description here


I don't believe that there is an issue with your SVG as it is 100% vector (no embedded PNG fies).

The most likely cause is the relatively small size of your image and how it renders at 72 dpi (a regular screen pixel density). The irregular edges of your font are being pixelised which is causing the image to look slightly blurred.

On a high resolution MacBook pro and iPhone retina, your logo looks fine and crisp.

It zooms up OK too.

enter image description here


Put this code on the page that is using Panzoom:

<style>        .panzoom {            -webkit-backface-visibility: initial !important;            -webkit-transform-origin: 50% 50%;        }</style>