Hacker News new | ask | show | jobs
by nickysielicki 2001 days ago
What sort of heuristic do you use to determine what areas need it? This seems like something a neural network would excel at.
1 comments

The actual implementation is bit of a fudge for performance reasons, but the general idea is based around amount of entropy: if a patch of an image already contains noise or intricate details, then I don't disturb it further with dithering. If it's flat, then it's safe to dither.

I also use Sobel edge detection and suppress diffusion at the edges, which fixes a particular quirk of FS where error is accumulated throughout a flat area and gets countered only at the edge when color changes (e.g. if an area should be brighter than the brightest color you have in your palette, dithering is unable to fix it, but all the "needs to be brighter!!!" error will accumulate and blow on next pixel that was supposed to be dark).