mirror of
https://github.com/javl/image2cpp.git
synced 2026-07-28 04:05:35 +00:00
Fix typo in Floyd-Steinberg comment
This commit is contained in:
+1
-1
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user