Eftersom jag är skyldig...
Det var jag som råkade kläcka ur mig det hela och detbevisar antagligen bara hur gammal jag är/svårt att lära gamla hundar sitta...
När jag själv programerade bild algoritmer och grafik så var det före respektive samtidigt med starten av definitionen av JPEG. Det jag lärde mig då är tydligen gammal modigt (jag programerar inte sedan länge...). Snabb sökning på nätet så hittar man JPEG FAQ'n där följande tämligen fullödade svar är saxat ifrån... Hoppas du förlåter mig att jag tydligen hade gamla uppgifter...
/Magnus
Subject: [13] Isn't there a lossless JPEG?
There's a great deal of confusion on this subject, which is not surprising
because there are several different compression methods all known as "JPEG".
The commonly used method is "baseline JPEG" (or its variant "progressive
JPEG"). The same ISO standard also defines a very different method called
"lossless JPEG". And if that's not confusing enough, a new lossless
standard called "JPEG-LS" is about to hit the streets.
When I say "lossless", I mean mathematically lossless: a lossless
compression algorithm is one that guarantees its decompressed output is
bit-for-bit identical to the original input. This is a much stronger claim
than "visually indistinguishable from the original". Baseline JPEG can
reach visual indistinguishability for most photo-like images, but it can
never be truly lossless.
Lossless JPEG is a completely different method that really is lossless.
However, it doesn't compress nearly as well as baseline JPEG; it typically
can compress full-color data by around 2:1. And lossless JPEG works well
only on continuous-tone images. It does not provide useful compression of
palette-color images or low-bit-depth images.
Lossless JPEG has never been popular --- in fact, no common applications
support it --- and it is now largely obsolete. (For example, the new PNG
standard outcompresses lossless JPEG on most images.) Recognizing this,
the ISO JPEG committee recently finished an all-new lossless compression
standard called JPEG-LS (you may have also heard of it under the name LOCO).
JPEG-LS gives better compression than original lossless JPEG, but still
nowhere near what you can get with a lossy method. It's anybody's guess
whether this new standard will achieve any popularity.
It's worth repeating that cranking a regular JPEG implementation up to its
maximum quality setting *does not* get you lossless storage; even at the
highest possible quality setting, baseline JPEG is lossy because it is
subject to roundoff errors in various calculations. Roundoff errors alone
are nearly always too small to be seen, but they will accumulate if you put
the image through multiple cycles of compression (see section 10).