I have been using Gifs for those small loading images. Have been working great except the occasional transparency issues and 8 bit colors. Now I found out about the APNG recently. But don't know if i should be using it. Does it have enough browser support? And what about the file size. A large gif image already has large file size...
I think APNG is better. As it supports 24-bit and 8-bit transparency. Moreover it is also supported by browsers like Mozilla Firefox, Chrome, Safari (see https://caniuse.com/#feat=apng).
Animated PNG is better than GIF if we're focused on file size – achieving a smaller file size was one of the reasons the APNG format was designed. In this image comparison test data, you can see that APNG is smaller than GIF for every image.
There is more browser support now (June, 2016) than there was when this question was asked. iOS Safari now supports APNG (since version 8) – that's a pretty big user base. So you can serve APNG to Firefox desktop and Android, Safari desktop and iOS, and serve GIF to all other browsers.
Cory Dowdy has some good comparison data here, including animated webp as well.
UPDATE 2018-12-4: Chrome, Opera, and desktop Safari now support Animated PNG. This has been true for several months.
Apng is a better format. GIF and apng are both lossless, but apng tend to be smaller, and better quality (more colors, and the ability for transparency) Unfortunately apng are largely unsupported, but that may change. Hopefully apng catches on.
Times have changed, please see below answers!
I'd definitely stick with GIF. I hadn't heard of APNG before, but from my research now, it sure sounds like it's almost unanimously unsupported. It sounds like Internet Explorer and Chrome don't support it, and that just seems useless for most users. Even if it is supported and my research on that was wrong, it's still only the most recent version or two that would. And for something where there's a very viable alternative, I'd hardly consider that risk to be worth it. And I know for a fact that my, latest version of IE didn't work with any of the example APNG files I came across.
It might be nice in a few years when/if it catches on, but for now it's just not a good idea.
© 2022 - 2024 — McMap. All rights reserved.