Dithering – Part 1

visualrambling.space

425 points by Bogdanp a day ago


hunter2_ - a day ago

This is halftone (i.e., an apparent palette with more colors than the actual palette, by ensuring that you aren't just rounding the same way everywhere) but it isn't dithering in my opinion. To me, dithering means fading away the banding that occurs when the palette (or the apparent palette achieved via halftone) isn't large enough to avoid banding on its own.

The halftone technique demonstrated here takes a palette of 2 colors and increases it to something on the order of 20 apparent colors, but even with 20 there are extremely obvious bands.

That banding can be virtually eliminated by having way more colors (say, 256 if grayscale, 256^3 if RGB) or it can be virtually eliminated via dithering. I suspect the "error diffusion" technique (which is teased at the end of this demo) does what I'm talking about.

Noise is the key to dithering, and I don't see any noise in this demo. Everything is deterministic.

But the presentation is spectacular!

jarjar2 - a day ago

Two videos from Daniel Shiffman's Coding Train:

Turning Images into Dots: The Magic of Dithering https://www.youtube.com/watch?v=0L2n8Tg2FwI

Coding Challenge 181: Weighted Voronoi Stippling https://www.youtube.com/watch?v=Bxdt6T_1qgc

laurentlb - 10 hours ago

Interesting topic. I appreciate the effort that went into this, there are some good animations.

But I find this kind of presentation much harder to read than a classic blog post. It's difficult to skim through the text to see how far it goes (and the article structure is not apparent); instead, I was kind of forced to read the text sentence by sentence (since I was familiar with the topic, I wanted to skip over the basics).

agys - 18 hours ago

I used different types of dithering (ordered, error diffusion) in many of my design projects as a visual language, static or animated, mostly for projects related to tech/computers/blockchain, sometimes combined with ASCII art.

There is a certain warmth (or maybe it’s just nostalgia) of these older techniques that can be harvested and combined with new ideas or new takes.

(Apologies for the Instagram links).

D.Y.O.R.:

https://www.instagram.com/p/DH1AjFzi3c6

D.Y.O.R. (printed):

https://www.instagram.com/p/Cjfzy23sCOg

Titles:

https://www.instagram.com/p/DHITpNYiWtF

Experiment on controlling the amount of dithering:

https://www.instagram.com/p/CYO_h9Yh18e/

IgorPartola - 20 hours ago

Very cool way to visualize it but I will be honest the threshold map doesn’t make sense. This didn’t seem to explain how to form the map, how to choose the threshold values, and so on. It showed grey pixels passing through white, black, and grey pixels and moved onto generalizing this pattern.

Is this just me being dumb or the curse of knowledge where something is so obvious to the author that they don’t even bother explaining it?

brson - 6 hours ago

I wanted to love this so much but my eyeballs were screaming trying to read the text over the crawling dither pattern.

veltas - 12 hours ago

Surely dithering is good enough to display 10-bit colour on a non-10-bit monitor with good colour.

The banding disappears and the noise introduced by dithering should hide the lack of depth completely to human eyes.

So a modern use for graphical dithering. And I'm sure there's more. It's not all for retro art.

ggambetta - 11 hours ago

Great presentation, loved the format! Looking forward to the other two parts.

I did a bit of ordered dithering on the ZX Spectrum Raytracer (https://gabrielgambetta.com/zx-raytracer.html#fourth-iterati...), it was surprisingly easy to implement and the results were great.

I wonder why it wasn't done more in the 80s (other than manual pixel art), probably just performance. I do remember seeing ordered dithering patterns in the 90s, in Windows 3.1 and in The Secret of Monkey Island VGA (I guess the backgrounds were hand-painted and scanned?).

joefourier - a day ago

Beautiful demo, but I’m not sure it’s accurate to call dithering an “illusion” of more shades than is available?

If you apply a low pass filter to a dithered image, and compare it to a low passed filtered thresholded, you’ll see that the “illusory” shades are really there in the dithered version, they’re just represented differently in the full resolution image.

Similarly, a class D amplifier emits purely off/on pulses before a low pass filter is applied, but no one would call the output an auditory “illusion”. In the case of image dithering, isn’t the low pass filter your own vision + the distance to the screen?

anteloper - a day ago

Good lord this is a beautiful web experience

bntr - 3 hours ago

Once I made a transition between two ditherings: https://github.com/bntre/dithering-gradient-py

estebank - a day ago

Obligatory link to the in-progress forum post about the development of The Return of the Obra Dinn's dithering effect: https://forums.tigsource.com/index.php?topic=40832.msg136374...

The difficulty for dithering on an interactive 3d scene is in making the dithering stable on camera rotation, otherwise you get a twinkling stars effect, not dissimilar to the "fireflies" in reflections in ray-traced games.

glimshe - a day ago

We had another dithering post a few days ago and nobody answered my question... I'm reposting in case someone who comes here knows the answer:

"Does anyone know of any application/tool that can perform palette dithering? The idea is "here is a n-color palette specified in their RGB values, here is the full-color RGB image, give me the best possible dithered image using the provided palette". The tools that I've used were underwhelming and produced results full of banding and artifacts.

Basically, great dithering in color instead of B/W."

EDIT: Thank you for the answers! I'll check all links.

janderson215 - a day ago

This was an amazing presentation! In one of the earliest screens, it is demonstrated that there are more or less 8 different shades of gray from just different patterns of black/white pixel arrangement. Is it possible to use the “blow up” view to classify the different shades of gray in an image to determine what the pattern should be for a given pixel grouping should be? Maybe this would be accomplishing the same thing the threshold filter accomplishes and have the same end result or possibly a different dithering method. Just trying to integrate this into my brain.

hackncheese - a day ago

Somehow my first time seeing Visual Rambling, absolutely beautiful site

chaidhat - 15 hours ago

This is really cool! I always thought dithering was just blending two colors by alternating adjacent pixels, I didn't know there was more ways to do it than one.

jzacharia - a day ago

I've been working on an implementation of this in Rust actually, weird timing. Cool article.

K0IN - a day ago

Hei, if someone wants to implement this, feel free to contribute this to my Phomemo M02 (a cheap < 15$) black and white thermal printer, web app.

https://github.com/K0IN/Phomemo-M02-Web

rezmason - 17 hours ago

I can appreciate the passion and consideration that went into this presentation of the subject!

cvanelteren - 9 hours ago

Amazing animations!

lampiaio - a day ago

Few things brighten my browsing day as much as a virtual ode to dithering.

Faizan711 - 7 hours ago

Amazing!!!

marstall - a day ago

unbelievable. gifted explainer!

snvzz - 21 hours ago

To the webpage author, I'd suggest adding WASD navigation as an alternative to cursor keys.

fortyseven - 8 hours ago

Ah, yes, the usual "Umm, ackshully this issunt dithering IMHO" segment of the audience is here.

ChrisArchitect - a day ago

There's a weird subset of graphic design grifters on social media obsessed with dithering right now.

Submission from the dev earlier https://news.ycombinator.com/item?id=45694750

seemaze - a day ago

While I enjoyed the whole presentation, my favorite part after progressing through the entire deck was pressing my back button once and landing right back here on HN :)