When it comes to image formats on the internet, it's generally a three-way tie between JPEG, GIF, and PNG. Deciding which image format to use is relatively straightforward; you choose lossy JPEG when you're saving continuous-tone photographic images, and you choose between lossless GIF or lossless PNG when you're saving images with large blocks of the same or similar colors. See my comparison of GIF/PNG and JPEG if you're not clear on what the difference is. But the choice between GIF and PNG is no contest. PNG is a more modern and vastly improved version of GIF that (almost) completely obsoletes it. You should always choose PNG over GIF, except in the following two circumstances:
There’s one little thing with pngout that might bite you. It removes gamma correction by default - so the images that uses gamma correction will look differently than the originals. You can tell it to keep the gamma correction for PNGs that needs it.
“If you are already be familiar with the pngcrush utility, you may be interested to know that PNGOUT can produce even smaller files than pngcrush -brute. With PNGOUT, however, you will need to find the right options yourself.”
One negative aspect of PNG is it is not 100% compatible with all versions of IE on windows. This is such a large issue I would say it’s mostly why it is not used more.
I’m so glad you talked about PNGOUT, most people never even consider it when discussing shrinking PNG’s.
Ken also has his own program PNGOUTWin that gives a GUI for PNGOUT. It costs a little bit of money, but for someone who compresses hundreds of image files it is very helpful.
I think we should stop saying “Major browsers don’t support PNG alpha”, because browsers is plural and the only browser not to support it is Internet Explorer (excluding of course 7).
There’s another annoying bug with PNG files within MSIE : colors are not correctly rendered. Example : body{background:#ddeffa} and body{background:url(bg.png)} (where bg.png is a plain one color image with color #ddeffa) are not the same with MSIE.
Typically, mixing PNG and JPG images with MSIE in a layout where you need background to blend correctly is a no-no.
For being such a graphics wiz I would think that Ken Silverman would have gotten out of the '90s style background. That is hideous!
Well, at least it is a 423 byte PNG file (utilback.png). He likes his PNG.
Wow. I never knew about PNG file size optimization. I’ll be converting Penny Arcade’s existing png’s ASAP.
If someone has any brilliant ideas about image compression in webcomic strips I’d love to hear about it. Take the image http://www.penny-arcade.com/images/2007/20070307.jpg for example. When I run pngout on a strip the result is often several times larger.
16:30 erik@spekkio % ./pngout-darwin -c2 -f5 -s0 20070307.jpg
In: 104908 bytes 20070307.jpg /c2
Out: 386332 bytes 20070307.png /c2 /f5
Chg: +281424 bytes (368% of original)
Time spent in user mode (CPU seconds) : 12.472s
Time spent in kernel mode (CPU seconds) : 0.030s
Total time : 0:14.48s
CPU utilisation (percentage) : 86.3%
Times the process was swapped : 0
Times of major page faults : 0
Times of minor page faults : 0
Don’t forget JPEG’s progressive rendering feature which does pretty much the same thing as PNG’s “2D interlacing” but with less comparative overhead. I remember in the late 90s most JPEGs used to load like this.
Hi Eric. My guess would be it’s because your input file is a JPG. That means it will have JPEG artifacts, messing up the whole “large areas of the same colors and hard transitions between them” thing.
I suspect you’d need to work off uncompressed or lossless image formats to see an improvement.
Hi Erik. My guess would be it’s because your input file is a JPG. That means it will have JPEG artifacts, messing up the whole “large areas of the same colors and hard transitions between them” thing.
I suspect you’d need to work off uncompressed or lossless image formats to see an improvement.