Making a dither pattern


For my daily art yesterday, i really wanted a dither pattern that looks like stars.
Unfortunately I could not find such a thing. So I made one.

a gradient dither radiating outward from the bottom left, going from yellow to dark blue, each step in the pattern looking like a star.

How does a dither work?

A dither is essentially a map from every colour to black or white, this is done by adding the source colour and the dither pattern together, and then forcing each pixel to either be black or white. (Coloured dithers are created by doing this to each channel, Red, Green, and Blue)

As such, this pattern is actually a bunch of pixels that add up so that they max out in a certain order.

Take the 2x2 General dither pattern:

A 2 by 2 grid of pixels, each pixel with a unique shade of gray.

It is simply four shades of gray, equally spaced from black to white. 
The top left corner of the pattern will be the first to turn white, as it is the closest to white. then the bottom right, then the top right, and finally the bottom left. It creates a gradient like so:

A gradient dithered with the 2x2 General Dithering Pattern

It can be thought of as several combining layers, with each layer being combined with all the previous ones to produce the desired pixel.

The four layers of the 2x2 General Dithering Pattern
Black here indicates transparency

Making the dither:

The method i have worked out is that, starting with a black background layer, for each stage of your dither you want, you create a layer with each pixel of the pattern filled in white.

You then need to calculate the opacity to set each layer to, I have found the best calculation is 100 divided by the number of layers, minus 1%. so (100/4)-1 is 24% in this case. Then setting each layer to that opacity level, with a black background at full opacity underneath everything, you get something that looks like the 2x2 General Dither.

I did find that you can add multiple new pixels in one layer, this is what i use to shape my dither pattern more, so that they form in star shapes!

Here is each layer for my star dither, again equating black to transparency here. And when merged together you get something like this:

A gif showing each of the seven layers of the star dither pattern The star dither pattern, with all layers combined.

A gradient dithered with the star gradient

Using the dither:

I personally use the dither by creating a group, in that group i add a normal layer, additive layer with the pattern, and then apply a threshold filter on to that group with the threshold level at 250 or so.

Example of layer setup in order to use the dither pattern

Things to keep in mind:

  • you should want your dither to be tileable

  • you can use filters to adjust the brightness range of the brightness

  • I have found a minimum value of maybe 5% brightness and a max of 95% works well, done by using filters to adjust the levels. a minimum of 0% will mean those pixels never turn on, and a maximum of 100% means that they will always be on.

  • This method should work for larger scale patterns, so if you want a pattern to be 100x100 pixels per tile or something you can do that!

You can download my star dither file, and the file for making dither bars that i used in the examples here as krita files:

star-dither.kra    dither-bar.kra


Shoutout to jimibo's post on ordered dithering, i don't remember when i ran into this post but it taught me a lot on how dithering functions which was essential to making this post and my dither pattern, and to PaclBat's post on compressing images, which doesn't have a lot to do with this it is just a fun post involving dithering.

Someone has also pointed out, since posting this, that there exist programs to make these patterns! One such one is ordered dither maker by Sean S. LeBlanc

#blog #art #how to