lottie-web icon indicating copy to clipboard operation
lottie-web copied to clipboard

scaled svg very pixelated/blurry in Safari

Open Mr-Kobra opened this issue 5 years ago • 9 comments

macOS Mojave After Effects 17.0.2 (CC 2020) newest Versions of Chrome/FF/Safari and Lottie/Bodymovin

When scaling a svg-animation in Safari (transform: scale(>1)), it will be rendered extremely pixelated/blurred. In Chrome and Firefox it renders without problems. Is this a known issue and/or is there a known workaround?

Mr-Kobra avatar Feb 06 '20 17:02 Mr-Kobra

Hi, can you share a link with an example of this case?

bodymovin avatar Feb 08 '20 20:02 bodymovin

Hi,

sure, you can find it here: http://kb.zeitweisen.com/Index.html

Like I said, in FF and Chrome it looks exactly as intended, whereas Safari shows an awful, misplaced animation.

Mr-Kobra avatar Feb 10 '20 10:02 Mr-Kobra

Same problem here, it looks great in Chrome. In Safari it shows blurry.

Chrome (version: 79.0.3945.130): Schermafbeelding 2020-02-11 om 15 46 53

Safari (version: 13.0.5): Schermafbeelding 2020-02-11 om 15 46 48

petertindemans avatar Feb 11 '20 14:02 petertindemans

It looks like this is an issue with how Safari (mobile and desktop) deals with CSS scaling and animated SVGs. I just came across this and am now refactoring everything by setting a larger width property and then using translate to scoot it into place :(

good-idea avatar Feb 28 '20 00:02 good-idea

@good-idea Yes, I ended up doing the same. It's less elegant but at least it works.

Mr-Kobra avatar Mar 03 '20 11:03 Mr-Kobra

I hava the same problem . svg is blurry in Safari .

svg element have transform: translate3d(0px, 0px, 0px);

I cover this style transform: unset !important;

It works for me

SealeyWang avatar Oct 21 '21 06:10 SealeyWang

I have the same problem.

Then I use object tag. It works for both image and animation.

<object type="image/svg+xml" data="/animated.svg">svg-animation</object> <object type="image/svg+xml" data="/image.svg">svg-image</object>

It works but not sure if it's proper. 😀

ALICE-YEN avatar Jun 21 '22 02:06 ALICE-YEN

I have the same problem.

Then I use object tag. It works for both image and animation.

<object type="image/svg+xml" data="/animated.svg">svg-animation</object> <object type="image/svg+xml" data="/image.svg">svg-image</object>

It works but not sure if it's proper. 😀

This is the only solution worked for me, thanks.

midoalone avatar Jan 18 '24 10:01 midoalone

I have the same problem.

Then I use object tag. It works for both image and animation.

<object type="image/svg+xml" data="/animated.svg">svg-animation</object> <object type="image/svg+xml" data="/image.svg">svg-image</object>

It works but not sure if it's proper. 😀

This solution causes a new issue on some browsers -- When attached a SVG file with mask, the background color is only transparent in light mode, but solid white in dark mode.

Light Dark

Tested on Worked: Safari on iOS 17 Failed: Edge 126 & Firefox 128 on Windows 11, Samsung browser 25 on Android 12

feeshy avatar Jul 25 '24 13:07 feeshy