News for hackers. Stuff that matters.
Re:PNG that works by unwind on Thursday March 17, 2011 @05:51AM (#2335586)
This:

When you need full color, but don’t need transparency, use JPEG instead.

implies that pixel-perfect results (non-lossy compression) is never desirable for images with full color, which I find to be a very provocative simplification.

On the other hand, on the web in general, perhaps it is good advice as a "rule of thumb" for people who aren't likely to deal with images where each pixel really matters.

Re:PNG that works by regularfry on Thursday March 17, 2011 @05:58AM (#2335604)
You can set JPEG compression levels such that it's lossless, which gives a filesize not dissimilar to PNG.
Re:PNG that works by masklinn on Thursday March 17, 2011 @06:01AM (#2335608)
> You can set JPEG compression levels such that it's lossless

No you can't. You can use Lossless JPEG instead, but regular JPEG (or JPEG2000) is a lossy format period.

edit: as tspiteri points out, JPEG 2000 does have a lossless mode. My bad. JPEG still does not though.

Re:PNG that works by DarkShikari on Thursday March 17, 2011 @07:46AM (#2335790)
There are actually two lossless JPEG modes even ignoring JPEG-2000: JPEG-LS and LJPEG. I don't know how widespread support for either is, but ffmpeg can encode to both. It confused the crap out of me a few months ago when I was trying to fix a bug and realized that the two were actually totally different formats.

The latter seems to be older and part of the original spec, while the former seems to be newer and a lot less bad.

Re:PNG that works by masklinn on Thursday March 17, 2011 @07:51AM (#2335799)
These are not modes, they're different formats (like very, very different) using the same name.

And yes, LJPEG is the "complete crap" version which predates (and was blown away by) PNG, JPEG-LS is a second take on a lossless jpeg format.

Re:PNG that works by tspiteri on Thursday March 17, 2011 @06:36AM (#2335657)
I don't know about JPEG, but JPEG2000 definitely has a lossless mode.
Re:PNG that works by copper on Thursday March 17, 2011 @07:42AM (#2335783)
> JPEG still does not though.

You're right in practise (AFAIK, libjpeg still doesn't support this mode), but see http://en.wikipedia.org/wiki/Lossless_JPEG

Re:PNG that works by masklinn on Thursday March 17, 2011 @07:52AM (#2335800)
I will simply quote myself:

> No you can't. You can use Lossless JPEG

Re:PNG that works by copper on Thursday March 17, 2011 @09:36AM (#2336014)
Duh. missed that one.
Re:PNG that works by getonit on Thursday March 17, 2011 @07:18AM (#2335726)
Did he mean it literally, or just that you can fiddle with compression until you don't notice any artefacts? At that point, it's as good as lossless for most uses, IMHO.
Re:PNG that works by masklinn on Thursday March 17, 2011 @07:48AM (#2335796)
> At that point, it's as good as lossless for most uses, IMHO.

It's not, and the size of the file blows up to insane levels.

Re:PNG that works by getonit on Thursday March 17, 2011 @12:42PM (#2336796)
Could you then give me a common use where a loss not noticeable to the human eye is, in fact, important?
Re:PNG that works by tiddchristopher on Thursday March 17, 2011 @01:35PM (#2337067)
When saving and closing an image, only to realize you need need to change something, thus necessitating a second save, which compounds loss. Granted, if you keep a lossless file around to edit, your problem is gone. But does everyone really do that with every file?
Re:PNG that works by getonit on Monday March 21, 2011 @08:26AM (#2349371)
That's the only one I could imagine encountering, and if I've not saved the original, serves me right AFAIC.

But then, if I save the second with a higher-than-otherwise-optimal setting, then I can reduce the compounding of effects. It's cost me filesize to limit loss to the imperceptible, but it's still possible.