5 ms·
You can set JPEG compression levels such that it's lossless, which gives a filesize not dissimilar to PNG.
by regularfry 16y ago
You can set JPEG compression levels such that it's lossless, which gives a filesize not dissimilar to PNG.
- masklinn 16y ago> 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.
- tspiteri 16y agoI don't know about JPEG, but JPEG2000 definitely has a lossless mode.
- getonit 16y agoDid 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.
- masklinn 16y ago> 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.
- getonit 16y agoCould you then give me a common use where a loss not noticeable to the human eye is, in fact, important?
- tiddchristopher 16y agoWhen 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?
- getonit 16y agoThat'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.
- copper 16y ago> 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 http://en.wikipedia.org/wiki/Lossless_JPEG
- DarkShikari 16y agoThere 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.
- masklinn 16y agoThese 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.