thorvg / thorvg.web

ThorVG for Web System
https://www.thorvg.org
MIT License
5 stars 1 forks source link

perf-test: ensure high animation quality across all players #8

Closed theashraf closed 2 months ago

theashraf commented 4 months ago

I've noticed that only lottie-web renders animations with the best quality, while thorvg and dotLottie-web animations are a bit blurry.

lottie-web

image

dotLottie-web & thorvg

Screenshot 2024-05-22 at 4 37 02 AM

[Suggestion] We can remove the hardcoded dotLottie web renderConfig devicePixelRatio and ensure that the thorvg canvas is resized for the best quality based on the devicePixelRatio, as it's implemented in dotLottie-web.

hermet commented 4 months ago

Hmm... This is the captured image from my testing device. I can't determine whether Lottie-web is better than the others like your captured image. The only noticeable difference might be the edge quality due to the different anti-aliasing mechanisms.

[left: thorvg, center: dotlottie, right: lottie-web] image

[thorvg] image

[dotlottie] image

[lottie-web] image

hermet commented 4 months ago

The important part is whether all three players output images at the same resolution. If one side outputs at a higher resolution, it can significantly affect performance measurement, so it is important to ensure they are the same.

Tested on my Windows Chrome browser:

  1. When scaled up the browser, lottie-web resolution is scaled up as well. Obviously, lottie-web considers a certain scale factor.
  2. When applied the devicePixelRatio to the dotlottie player, I can assure its quality is better than lottie-web in default scale factor (100%).

Tested on MacBook,

  1. Lottie-web quality is better than others. It appears to be scaled up to match the device's pixel ratio.
hermet commented 4 months ago

See also: https://github.com/thorvg/thorvg/issues/2305

hermet commented 4 months ago

More Test factors.