ditherImageBlueNoise function
Dither an image using a blue-noise threshold mask. Unlike Bayer matrices, blue noise distributes error in a less structured, visually pleasing high-frequency pattern that avoids the grid artifacts of ordered dithering.
The mask is a 64×64 tile generated once via the void-and-cluster algorithm and reused across calls.
quantizer is the color reducer used to map each pixel to the palette;
if null (the default) a NeuralQuantizer is built from image.
strength scales the dither offset (defaults to 1.0 for the full-range
look; smaller values give subtler banding reduction).
Implementation
img.Image ditherImageBlueNoise(
img.Image image, [
img.Quantizer? quantizer,
double strength = 1.0,
]) {
quantizer ??= img.NeuralQuantizer(image);
return ditherImageOrdered(image, quantizer, _blueNoiseMask, strength);
}