Fix typo in Floyd-Steinberg comment

This commit is contained in:
Jasper van Loenen
2026-01-19 17:02:13 +01:00
committed by GitHub
parent 47a367f6d0
commit e9cb702c89
+1 -1
View File
@@ -53,7 +53,7 @@ function dithering(ctx, width, height, threshold, typeIndex) {
const map = Math.floor((imageData.data[currentPixel] + bayerThresholdMap[x % 4][y % 4]) / 2); const map = Math.floor((imageData.data[currentPixel] + bayerThresholdMap[x % 4][y % 4]) / 2);
imageData.data[currentPixel] = (map < threshold) ? 0 : 255; imageData.data[currentPixel] = (map < threshold) ? 0 : 255;
} else if (type === 'floydsteinberg') { } else if (type === 'floydsteinberg') {
// Floyda€"Steinberg dithering algorithm // Floyd-Steinberg dithering algorithm
newPixel = imageData.data[currentPixel] < 129 ? 0 : 255; newPixel = imageData.data[currentPixel] < 129 ? 0 : 255;
err = Math.floor((imageData.data[currentPixel] - newPixel) / 16); err = Math.floor((imageData.data[currentPixel] - newPixel) / 16);
imageData.data[currentPixel] = newPixel; imageData.data[currentPixel] = newPixel;