Hacker News new | ask | show | jobs
by DitheringIdiot 1682 days ago
nathaniel here, writer of the article this article is referencing.

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.

12 comments

Good and gracious response. Well done! If it helps, you are far from alone in making "enjoyable" mistakes. The important thing is to continue learning. Here is one of my favorite quotes on the subject:

“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 Merlin
You're not as wrong as you think.

Dithering 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.

> Dithering allows you to display images with a limited color palette, thus reducing the file size.

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.

[1]: https://en.wikipedia.org/wiki/Colour_banding

This makes me think that one could store less significant bits of the channels with a lower spatial resolution ...

... 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?

Interactions like this are why I spend my "social media" time on hacker news. Good on you for building the tool in the first place, and for being willing to admit a mistake.
You have the absolute best possible nickname for this post as well. Why bother doing things based on good premises when bad premises can feel this good?
My life would be better in general if I were more willing to make mistakes in public.
> 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.

There's really no better way to learn, in my experience.

This was a fantastic and gracious response. Nicely done!
The app is still cool and useful, just not for its original purpose.

(Interesting choice of username!)

That username is :chef’s kiss: .
FWIW I love the app and have been using it a lot just because.

I think the real value is that it presents a novel idea of considering image compression creatively.

I would give gif a shot to see if you can get some savings applying dithering there
Well done.