Chrome显示Lottie动画模糊
我遇到了鳞片动画的问题,使动画模糊了。当动画缩放时,这尤其是可见的。
在我的示例中,原始动画是842x596px,因为较小的渲染情况会变得更糟,结果得到结果:
这是示例代码,如果您想在Chrome浏览器中复制它:
lottie-player {
border: 1px solid lightblue;
}
body {
color: lightgray;
}
<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
<!--
<lottie-player src="https://assets6.lottiefiles.com/packages/lf20_srq2xawa.json" background="transparent" speed="1" style="width: 300px; height: 300px;" loop controls autoplay></lottie-player>
300x300px
-->
<lottie-player src="https://assets6.lottiefiles.com/packages/lf20_srq2xawa.json" background="transparent" speed="1" style="width: 200px; height: 200px;" loop autoplay></lottie-player>
200x200px
<lottie-player src="https://assets6.lottiefiles.com/packages/lf20_srq2xawa.json" background="transparent" speed="1" style="width: 150px; height: 150px;" loop autoplay></lottie-player>
150x150px
<lottie-player src="https://assets6.lottiefiles.com/packages/lf20_srq2xawa.json" background="transparent" speed="1" style="width: 100px; height: 100px;" loop autoplay></lottie-player>
100x100px
<lottie-player src="https://assets6.lottiefiles.com/packages/lf20_srq2xawa.json" background="transparent" speed="1" style="width: 50px; height: 50px;" loop autoplay></lottie-player>
50x50px
似乎已经有其他问题有类似的问题,但没有提供更多信息或不提供工作解决方案:
- lottie Animation仅在chrome上模糊
- Chrome上的CSS动画上的模糊内容
- 使用CSS变换后的问题/14677490“>模糊文本:scale();在chrome 中
I have the issue with scaled Lottie animation that Chrome blurs the animation. This is especial visible when the animation is scaled.
In my example, the original Animation is 842x596px as smaller it gets renders as worse gets the result:
Here is the example code, if you want to reproduce it in your Chrome Browser:
lottie-player {
border: 1px solid lightblue;
}
body {
color: lightgray;
}
<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
<!--
<lottie-player src="https://assets6.lottiefiles.com/packages/lf20_srq2xawa.json" background="transparent" speed="1" style="width: 300px; height: 300px;" loop controls autoplay></lottie-player>
300x300px
-->
<lottie-player src="https://assets6.lottiefiles.com/packages/lf20_srq2xawa.json" background="transparent" speed="1" style="width: 200px; height: 200px;" loop autoplay></lottie-player>
200x200px
<lottie-player src="https://assets6.lottiefiles.com/packages/lf20_srq2xawa.json" background="transparent" speed="1" style="width: 150px; height: 150px;" loop autoplay></lottie-player>
150x150px
<lottie-player src="https://assets6.lottiefiles.com/packages/lf20_srq2xawa.json" background="transparent" speed="1" style="width: 100px; height: 100px;" loop autoplay></lottie-player>
100x100px
<lottie-player src="https://assets6.lottiefiles.com/packages/lf20_srq2xawa.json" background="transparent" speed="1" style="width: 50px; height: 50px;" loop autoplay></lottie-player>
50x50px
It seems there are already other question which have a similar problem but don't provide further information or don't provide a working solution:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该问题是由Lottie动画内部SVG上的以下样式标签引起的:
最简单的解决方案是通过JS删除此标签:
The issue is caused by the following style tag on the SVG inside the Lottie animation:
The simplest solution is to remove this tag via JS: