what is lossless?

Cédric Louvrier said on 09/21/2017

you could see on this website or elsewhere some mentions about lossless or visually lossless: some people/developers have they own definition about this so it could be somehow confusing

:: lossless
pingo -lossless image.png

lossless: all the data, included unused for Web usage, can be restored in a lossless way. in this case, pingo preserves all RGB data (even if alpha is 0), all chunks and last modification date

:: visually lossless
pingo -s0 image.png

visually lossless: pingo preserves all used (displayed) data and removes unused. the image is displayed in a web browser just like the original: all pixels are strictly identical

original lossless visually lossless
47,8 KB 46,0 KB 13,2 KB

i consider anything else as lossy: if used data is altered in any way, even if i can not see any differences with my eyes. for Web usage, it could be more efficient to use a lossy way most of the time

anonymous said on 10/06/2017

i would like to repeat here what I already sent in a support message because I am not sure if it was delivered or I actually failed to send it.

I am working in image/movie industry. Here, when we talk about:

- visually/virtually lossless we actually mean lossy compression that can not be noticed by a untrained human eye. Continuous application of the same compression over and over again may eventually lead to visible quality degradation. Final masters of a finished movie or show are often compressed by such methods for long-term storage or for sending to other companies or even divisions of the same company.

- mathematically lossless - no matter how many times you compress, DECODED/UNCOMPRESSED output will always be identical to the DECODED/UNCOMPRESSED input.

In both cases above we are not concerned about any other supplementary data such as meta tags, timestamps etc and this information can be changed or lost.

When you say "visually lossless", it seems you mean that not only it is mathematically lossless, but it also retains some of the supplementary information. I would not argue about usefulness of this feature, for web stuff maybe it is, but if you accept that not only web developers may be interested in your articles, the name should be changed to something else.

anonymous said on 10/06/2017

No I am being confusing myself. I meant to say:

When you say "lossless" you mean mathematically lossless with intact timestamps etc.

When you say "visually lossless" you mean mathematically lossless where supplementary info may be gone.

This leads to a confusion. The fact that timestamps etc. are intact should be indicated in some other way and the term "visually lossless" changed in many cases.

For example, as I understand if we have 32bit png that actually have 128 colors in it.

By default compression tool may produce a file that will be reduced to a 8bit png and timestamp may be changed. This would be visually lossless by your definition. This, however will be mathematically lossless or just "lossless" but established convention because when source and output will be decoded, the output bitstream will be identical.

cédric (dev) said on 10/09/2017

your post has been submitted and commented

comment this