Ordered dithering with Bayer Matrix

This requires a 2-dimensional C array.

Instead of using a random value added to the pixel values, it uses one from a grid pasted over the entire image, that follows a specific recursive pattern.

Pasted image 20260820165427.png

Pasted image 20260820165524.png

Here it is with level 12

bayer.png

And here it is with level 2

bayer2.png

There is a dithering level for each image where it looks the best, and beyond that seems to make no real difference.