Animated .GIF vs Spritesheet + JS/CSS

后端 未结 8 479
忘了有多久
忘了有多久 2020-12-23 11:51

Which will scale best for performance, file-size, (and my sanity): Animated .gifs or a spritesheet with animations using CSS (and JS when need be)?

File

8条回答
  •  春和景丽
    2020-12-23 12:25

    Animated gifs only give you binary transparency (a pixel is transparent or totally opaque). That's why most animated gifs look bad on transparent backgrounds because you cannot apply antialiasing (like your squirrel, some antialiasing there would do wonders).

    If you want to have PNG-24 transparency quality you have to go with animated sprites.

    Also, animaged sprites performs really well if you draw them on a canvas. Look this: http://seb.ly/demos/bunnybench/bunnies_canvas.html

提交回复
热议问题