There are five kinds of lossless compression touched in this thread.
1) Binary lossless: One where the respective .BMP/.JPG/.whatever file looks the same byte-by-byte when examined with the binary file.
2) Exact lossless, where ARGB all are preserved even when A = 0.
3) Lossy transparent, where RGB is not preserved when A = 0, i.e., the transparent color doesn't have a specified color, other colors are specified losslessly. This is the most common kind of lossless by modern high-performance image compressors such as FLIF, PNG optimizers, and WebP joined this club half a year ago in 0.5.0 (didn't check, can be off by a few months). ZopfliPNG allows this with --lossy_transparent, but probably making it default there too would make more sense. When such an image is rendered using normal alpha blending or additive or subtractive alpha-blended rendering, the rendered result is equivalent to the exact lossless.
4) Visually-lossless, a method of lossy compression where the loss is small enough that it can be expected that humans don't notice the difference.
Glossary definition of visually lossless (from
http://www.digitizationguidelines.go...suallylossless) is below:
"""A form or manner of lossy compression where the data that is lost after the file is compressed and decompressed is not detectable to the eye; the compressed data appearing identical to the uncompressed data."""
For example libjpeg quality 100 could be considered visually lossless, even when actual rendered pixel values change a bit.
I think this is a great definition for visually lossless. We are working hard to be able to decide this automatically by using butteraugli. Being able to automatically choose from a variety of methods and take the smallest file size that gives visually lossless image is often favorable to 'exact lossless' or 'lossless' compression, particularly in the end delivery such as the web sites.
5) Near-lossless compression. Near-lossless is defined usually with a guarantee of the maximum error. The image may look really bad, but none of the ARGB values are further away from the original than say 8 or 16 values. A good near-lossless encoder needs to apply other constraints to the image than trying to just obtain the maximum error everywhere with the highest possible compression ratio.