Top
Best
New

Posted by venusgirdle 4/13/2025

Writing my own dithering algorithm in Racket(amanvir.com)
172 points | 40 commentspage 2
turnsout 4/13/2025|
This is awesome! But be careful, if you dig much further you're going to get into blue noise, which is a very deep rabbit hole.
pixelpoet 4/13/2025||
The thresholding should be done in linear space I think, not directly on the sRGB encoded values.

Also I think the final result has some pretty distracting structured artifacts compared to e.g. blue noise dithering.

jansan 4/13/2025||
I think implementing a dithering algorithm is one of the most satisfying projects, because it is fun, small(ish) and you know when you are done.

Of course, unless you are trying to implement something completely insane like Surface-Stable Fractal Dithering https://www.youtube.com/watch?v=HPqGaIMVuLs

lampiaio 4/13/2025||
Wouldn't it make more sense to display the samples at 100% in the article? Had to open the images in a new tab to fully appreciate the dithering.
sho_hn 4/14/2025|
Thanks for pointing this out. The embedded scaled version (which isn't clickable) had artifacts for me, and wasn't very nice.
v9v 4/13/2025||
I love the small image previews to the left of the lines of code loading and saving images. Which editor is this?
venusgirdle 4/13/2025|
I love them too :)

Visual Studio Code with this extension: https://marketplace.visualstudio.com/items/?itemName=kisstko...

ralphc 4/14/2025||
I'll start off admitting to not digging into the article yet, but is this something that can be broken up and done in parallel? I'm an Elixir fanboy so I try to parallelize anything I can, either to speed it up or because I'm an Elixir fanboy.
archerx 4/14/2025|
Most image processing can be multithreaded, you just have to chunk the image and send each chunk to a thread. You might have to pad the chunk based on the processing you’re doing i.e convolution which needs the neighboring pixels per pixel to work.