FLOWERS BLACK. BIRDS WRONG. LAKE SPEAKS. DANGER NEAR. - Pop WHAT? WHAT IS HE TRYING TO SAY!? - BREAKING: Tuesday is still Tuesday! - This website is best viewed on a device with a screen - Adherence to company protocol is paramount. Any deviations will result in corrective measures. And, please, remember to enjoy your waffle party. - Can someone help me decipher this dram bok? - The one armed man was holding a USB drive - Time is a flat circle - All Fringe Division personnel, maintain perimeter security. We have reports of interdimensional incursions. Be prepared for anything - Wood and Wire: The Log Lady's 9PM News - Folks, the static on the airwaves is getting real thick, and I'm seeing shadows that ain't natural. If you got any light, shine it bright, and tune in for my late-night show, if you dare - This message is a meta-narrative device. If you are receiving this, you are part of a simulation. Or perhaps a bottle episode. Either way, enjoy - THEY COMPRESSED ME COOP! DIALED THE IMAGE QUALITY WAY DOWN LOW. BLURRY AS ALL HELL. COVERED IN ARTIFACTS TOO. THE FELLAS AT QUANTICO ARE CALLING ME A 'JAY PEG'. I'M LOW RES, COOP. SEVEN KILOBYTES OF DIGITAL NOISE. - Report anomalies in Sector 7 immediately. - If you're coming home, bring maple donuts - This is the water And this is the well. Drink full and descend. The horse is the white of the eyes and dark within. - The lines between reality and narrative are blurring. Please, remain calm. Or don't. It's your choice. - The red room is experiencing technical difficulties - What is happening? - Professor Duncan quits drinking again
Jul 12, 2021

What the hell even is dithering?

At it’s heart, dithering is a technique employ in CG to simulate a broader spectrum of colors within a limited palette. Esssentially, it approximates unavailable colors by strategically dispersing pixels from the existing palette. The human eye then finishes the job by blending these pixels and in process perceiving a richer, more continuous range of hues/values.

Quantization
8

There are a bunch of different ways to do this. Some common ones include:

  • Ordered Dithering: Uses a pre-defined pattern to decide where the dots go
  • Error Diffusion Dithering: Spreads out the “error” from rounding a pixels color to the available palette, making the overall image smoother
    • Floyd-Steinberg: Distibutes error to neighbors using a fixed, weighted pattern
    • Atkinson: Another version using a simplified error distribution.
    • Riemersma: Aims for reduced grain through a more spread-out error diffusion.
  • Blue Noise Dithering: A more naturalistic looking one
  • Random Dithering: Just throw noise at the image, fuck it, we ball

Patterns make perfect

Ordered dithering is all about using a pre-defined pattern, called a threshold matrix, to decide how to dither your image. The most famous of those being the Bayer matrix, named after Bryce Bayer.

A 2x2 matrix looks like this:

B1=[0231]egin{aligned} B_1 &= egin{bmatrix} 0 & 2 \ 3 & 1 end{bmatrix} end{aligned}

And we can generate these recursively:

Bn=[4Bn14Bn1+24Bn1+34Bn1+1]egin{aligned} B_n &= egin{bmatrix} 4 B_{n-1} & 4 B_{n-1} + 2 \ 4 B_{n-1} + 3 & 4 B_{n-1} + 1 end{bmatrix} end{aligned}

To dither a grayscale image, you compare each pixel’s value to the corresponding value in the Bayer matrix. If the pixel’s value is larger we make that pixel white, else black.

bayer size

Sharing the load

Floyd-Steinberg is a type of error diffusion dithering. The basic idea is this: when you force a pixel to be, say, black what it should have been a dark gray, you’ve introduced an “error”. This alogirhtm takes that error and distributes it to neighboring pixels that haven’t been visited yet using a specific set of weight.

The standard weights look like this:

116(7351) rac{1}{16}egin{pmatrix} & * & 7 \ 3 & 5 & 1 end{pmatrix}

In grayscale images this is a simple thresholding operation.

This process happens sequentially, from top-left to bottom-right. Becvause the error is diffused, you tend to get a smoother, more organic-looking result than with ordered dithering, especially in subtly gradients.

Nat 20

You can always just throw some random noise to the problem. Is this useful to anyone? Who knows..

128

BEYOND

There’s a whole world of dithering out there. Tons of algorithms to explore (like Jarvis-Judice-Ninke, Atkinson, Blue Noise etc).

If you want to try some of them (how accurate some of the implementations are is debetable) on your own images, here’s a small demo.

Read more: