
It then rounds the value to the 8-bit palette. To create a gradient, a program such as Inkscape has first to make a floating-point calculation that yields a floating-point representation of the color levels in all channels. The Bayer matrix creates a pattern that looks like cross-stitches, and should look familiar to you if you like low-tech stuff. Or you can create patterns such as lines and circles. You can sum a random uniform white noise for example. To make a dithering you sum a certain signal to the image before rounding. 8-bit depth is to simply round the value. When you have an image with large depth, such as in floating point, the normal way to convert it to e.g. There are different ways to create this pattern, the one I used is based on the Bayer matrix. It is based on the fact that if you smooth out a pattern with two different color tones you get an intermediary tone. It seems to be working fine, I’ll show here some demonstration pictures and also provide a patch.ĭithering is a technique to reduce the number of color levels of an image, or its bit depth. So I challenged myself to implement a basic dithering into Inkscape’s gradient during the weekend. It all started when I created a logo for my school department, rendered it in high resolution and was disappointed with how the gradient looked.

Last sunday at 22:00 I finished a cool weekend hacking project! This post tells how I tweaked the Inkscape source code to enhance its gradients with a dithering technique, to make them look better and avoid the so-called “banding” effect.
