4 ms·
This chart offers some dubious suggestions, even ignoring the "Burn it with fire" bit. Unfortunately, it doesn't explain any of its reasoning. A photograph tha
by beering 7y ago
This chart offers some dubious suggestions, even ignoring the "Burn it with fire" bit. Unfortunately, it doesn't explain any of its reasoning.
A photograph that's not real big is probably still better suited for JPG. And there's no reason to use GIF for any still image - PNG will be superior in all situations. A moving image may be better off as an MP4 for modern browsers in terms of file size and quality, but there's no mention of that here.
- avhon1 7y ago> there's no reason to use GIF for any still image - PNG will be superior in all situations For small icons with few colors, I find GIFs to be consistently smaller than PNGs. For example, my website's favicon: http://alexvh.me/favicon.gif 216 bytes http://alexvh.me/favicon.png 1041 bytes
- jandrese 7y agoOne of the problems with PNG is that many applications default to full-color-with-alpha-channel as the only save method, even though PNGs can do paletted images just as well as GIF and end up basically the same size. So people look at their PNG files and wonder why they are so big compared to the old GIFs because their application sucks. Edit: I just tried it with your example: % giftopnm favicon.gif | pnmtopng > favicon.png pnmtopng: 5 colors found % ls -l -rw-r--r-- 1 jandrese jandrese 216 Aug 7 17:33 favicon.gif -rw-r--r-- 1 jandrese jandrese 255 Aug 7 17:33 favicon.png
- JoshTriplett 7y agoDon't forget to run oxipng or optipng, as well; pnmtopng doesn't produce optimal PNGs. (In this case, it just saves 3 bytes, but it can make a huge difference sometimes.)
- jandrese 7y agoI actually pngcrushed the result after that just to see how many of the remaining 39 bytes I could get back, but had the same result. PNG has just a smidge more fixed overhead than GIF.
- JoshTriplett 7y agooxipng got it down to 248 bytes. And yes, PNG has a little more fixed overhead, such as the IEND chunk and some of the required IHDR metadata. That only tends to be an issue in files this small, though, and gets dwarfed by potential savings in larger files.
- avhon1 7y agoNeat trick! I exported from GIMP and then used pngcrush. Interesting that this case isn't covered by that workflow.
- beering 7y agoYou are right, I tried creating a 16x16 image with 3 colors and despite my best attempts, the GIF came out to 93 bytes and the PNG 139 bytes. So there are cases where the GIF will be smaller than the PNG. On the other hand, if you are loading enough small PNGs for this to make a difference, perhaps any performance issues that come up might be helped by switching from PNG to GIF.
- beering 7y agoSorry, that should read "might not be helped".
- KaoruAoiShiho 7y agoAlso apng. Time to retire gifs already.
- PinkMilkshake 7y agoIt might happen! IE and Edge were the last holdouts and now MS is switching to Chromium.
- jandrese 7y agoHasn't apng been made obsolete by mp4 before it managed widespread adoption? Basically they were supposed to be easy like the old animated gifs, but developers dragged their heels on it so long that they forced people to adopt the full fat alternatives in the meantime.
- KaoruAoiShiho 7y agoThey have different perf characteristics. I use apng a lot. There's a good place for them.
- the8472 7y agoapng also supports transparency while h.264 doesn't.