News for hackers. Stuff that matters.
Re:The PNG image file format is now more popular than GIF by sk5t on Thursday January 31, 2013 @10:38AM (#5145424)
More numerous perhaps, but not more important--going by the insane explosion in animated GIFs in the last two years... I think folks would have stuck by JPEG if it offered transparency.
Re:The PNG image file format is now more popular than GIF by mistercow on Thursday January 31, 2013 @12:56PM (#5146231)
That's hard to say. Saving the 512x512 FireFox logo, for example (with white background for fair comparison) at 99% quality JPEG from GIMP saves less than 5% space over PNG, and for images with even more solid white and simple gradients, PNG will beat high quality JPEG.

Even more importantly, frequency-domain compression is really not a very good alternative for most alpha channels for two main reasons.

First, most alpha channels are dominated by large regions of full transparency or full opacity. PNG thrives under those conditions. JPEG does OK.

Second, ring artifacts are a big problem for alpha channels. Whereas a ring artifact in a chroma channel will often be completely imperceptible to the viewer, a ring artifact on an alpha channel can turn transparent pixels opaque. Unless you correct the non-alpha channels to account for those artifacts on the alpha channel, you'll end up with noticeable black halos, even at relatively high quantization. That correction is difficult, and even if you do it well, the results are not stellar.

So while a hybrid format might work well, JPEG + alpha is not as simple as it sounds.

Re:The PNG image file format is now more popular than GIF by ZeroGravitas on Thursday January 31, 2013 @11:28AM (#5145725)
Animated GIF, the royalty-free web video standard that Apple and Microsoft couldn't prevent you from using.
Re:The PNG image file format is now more popular than GIF by Zirro on Thursday January 31, 2013 @10:44AM (#5145454)
"...going by the insane explosion in animated GIFs in the last two years... I think folks would have stuck by JPEG if it offered transparency."

That does not make sense as JPEG doesn't support animation. Regardless, the blurriness caused by normal JPEG-compression levels makes it a bad option for most non-photo images.

Re:The PNG image file format is now more popular than GIF by prezjordan on Thursday January 31, 2013 @10:47AM (#5145487)
I believe parent was saying PNG folks would have stuck with JPEG if it offered transparency.
Re:The PNG image file format is now more popular than GIF by Zirro on Thursday January 31, 2013 @10:58AM (#5145538)
Indeed, it seems that way after reading through it again and inserting a dot.

I would still argue that images used in the layout of the average site, most of which are already prone to having transparent parts, are better off using a lossless rather than a lossy format.

Re:The PNG image file format is now more popular than GIF by sesqu on Thursday January 31, 2013 @11:18AM (#5145656)
You're underestimating the number of non-photographic JPEG files in use despite lacking transparency. It appears a significant number of people don't care about artifacts.

That said, JPEG does today support lossless compression, if you really want to go there. It sort of even supports transparency[1].

[1] http://news.ycombinator.com/item?id=1772760 for a javascript solution; other approaches use container formats

Re:The PNG image file format is now more popular than GIF by vacri on Thursday January 31, 2013 @03:51PM (#5147377)
jpegs are for photos, and are the wrong thing to use for things like icons, screenshots, web images and so forth.
Re:The PNG image file format is now more popular than GIF by unconed on Thursday January 31, 2013 @05:47PM (#5147989)
Actually, in a Retina world, it is often better to use a low quality JPEG at high res, than a high quality PNG at low res.
Re:The PNG image file format is now more popular than GIF by kbolino on Thursday January 31, 2013 @08:53PM (#5148719)
Well, besides the fact that we don't actually live in a "Retina world", the use of JPEG, even on high quality settings, for an artificial (= not taken from a camera) image pretty much precludes the ability to produce derivative works from it without a much more serious loss of quality. That's not to mention that there are some things which high resolutions cannot make up for, like color bleeding and other pretty serious fuzzing that JPEG can introduce at low quality settings.
Re:The PNG image file format is now more popular than GIF by unconed on Sunday February 03, 2013 @11:35PM (#5162443)
The point is that at high DPI, the "serious fuzzing" is much less noticeable for a variety of images. A retina screen has 4x the amount of pixels. Which means the 2x2 undersampled color errors are probably below our perception threshold. Especially if you pre-blur your high res image to a small degree, acting like an anti-aliasing filter when you scale it down by a factor of e.g. 1.5. For mobile, where users will be zooming a lot anyway, this is a very useful strategy to consider, which can absolutely beat PNG in image quality. Doesn't mean you have to do it everywhere, but I'd prefer it to having to download megabytes of images on retina devices.

It is very rare that a website has only perfect vector line art in its images. PNG sucks at compressing non-trivial gradients for example.

Re:The PNG image file format is now more popular than GIF by kbolino on Monday February 04, 2013 @07:05PM (#5168146)
You've set up a false dichotomy, I think. Why use high-res low-quality images instead of just sticking with low-res high-quality images? It's all going to look fuzzy when you zoom in.

Also, palette images should get some love too. A high-res dithered GIF or 8-bit PNG might meet your needs (looks good on retina displays at normal zoom, stays crisp when zoomed in, smallish file size) better than the other options.