by DitheringIdiot · 5y ago · 0 comments
If it's okay with you I'll update the original with a link to this at the top. It's sort of hilarious that I made an whole app based on a premise that is basically just wrong.
I wish I could say I've learned my lesson, but I'll probably continue to make enjoyable mistakes like this for the rest of my life.
“The best thing for being sad," replied Merlin, beginning to puff and blow, "is to learn something. That's the only thing that never fails. You may grow old and trembling in your anatomies, you may lie awake at night listening to the disorder of your veins, you may miss your only love, you may see the world about you devastated by evil lunatics, or know your honour trampled in the sewers of baser minds. There is only one thing for it then — to learn. Learn why the world wags and what wags it. That is the only thing which the mind can never exhaust, never alienate, never be tortured by, never fear or distrust, and never dream of regretting. Learning is the only thing for you. Look what a lot of things there are to learn.”
T.H. White, The Once and Future King via MerlinDithering allows you to display images with a limited color palette, thus reducing the file size.
However the image formats chosen here don't really benefit from that.
Dithering is particularly effective in bitmap formats that use a palette (GIF, for instance). Just make sure your gif is actually saved with less bits-per-pixel than your original image.
It's however true that these formats that benefit aren't exactly modern, and there would be better ways of saving the same image.
At the end of the day, dithering can still be aesthetically pleasing. There might yet be a use for your app.
I think that sentence is misleading and is what caused the initial misconception.
Reducing the color palette is a technique for reducing file size. For example, say you have a grayscale image using 8 bits per pixel (256 colors). Ignoring other compression techniques, you can cut the size of the image in half by reducing it 4 bits per pixel (16 colors).
The naïve way to reduce bit depth is by discarding the low order bits, since they carry the least information. However, when you do that, the result is banding [1]. Banding is an unsightly artifact.
Dithering exists essentially to deal with banding. It works by (sort of) adding a slight amount of noise to the pixel values to diffuse the transitions between diffferent thresholds.
But anyone with an ounce of information theory will tell you that noise by definition is literally the hardest thing to compress. So when you dither an image, you are throwing away almost all of the gains you got by reducing the bit depth in the first place.
... Wait, this is what JPEG is, isn’t it? Why aren’t there dithering decoders for it, in this case? Is the block too small?
There's really no better way to learn, in my experience.
(Interesting choice of username!)
I think the real value is that it presents a novel idea of considering image compression creatively.