3 ms·
> In fact, modern compression will do a much better job giving you a smaller file size if you don't use dithering. Not necessarily. The idea of dithering is t
by vikingerik 5y ago
> In fact, modern compression will do a much better job giving you a smaller file size if you don't use dithering.
Not necessarily. The idea of dithering is to use a representation with a smaller color space, meaning fewer bits per pixel, possibly palettized.
The idea is to control where the lossiness "damage" happens. You deliberately discard information in the area of color depth, rather than whatever the modern compression might choose to discard. It's possible you could get results that to an observer appear subjectively better per file size.
Imagine a photo of masonry brickwork. What's important is the edges between the brick and mortar, while you don't really care about the grain within a brick. General-purpose image compression tends to smear sharp edges like that. It's possible you could do subjectively better by reducing the color depth, to intentionally discard more of the data that you don't need with dithering to keep a little of it, while keeping more of the information you do want in the sharp edges.
I'm not claiming any of this would pan out for real-world use, but there are certainly hypothetically feasible cases for dithering.
- ohazi 5y agoIn practice, video inspired image compression techniques (i.e. HEVC Main Still Picture) will do a significantly better job on that masonry brickwork image. The algorithm is already looking for patches of image that have moved by possibly hundreds of pixels (to sub pixel accuracy) both within a single frame, and across multiple frames. Basically, it'll find a patch of image that, when shifted horizontally and vertically by a certain amount, looks pretty close to the patch of image that it's trying to encode. The compressor will then say "just copy that region that you decompressed half a frame ago to here first, and now the residual values I give you are differences between the first patch and the second." Even if the brick / mortar phase is slightly off (e.g. from perspective or lens effects), this will give you about an order of magnitude more compression efficiency (and perceptual quality) than anything that tries to use color depth to preserve edges.
- pornel 5y agoYour example is about saliency and perception. Modeling these to guide lossy compression is an important feature of high-end encoders, but that is largely independent of compression techniques used. It's possible to do optimal-ish highly compressible dither (it's been done for LZW), but the results are still pretty disappointing compared to even old JPEG.