Skip to content

Commit

Permalink
speed
Browse files Browse the repository at this point in the history
  • Loading branch information
Dor-sketch committed Jun 26, 2024
1 parent d7bed2b commit 8c1f86e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@

const img = new Image();
img.onload = function () {
const MAX_WIDTH = 9*32;
const MAX_WIDTH = 500;
let targetWidth = img.width;
let targetHeight = img.height;

Expand Down Expand Up @@ -295,7 +295,7 @@
const data = imageData.data;
for (let i = 0; i < data.length; i += 4) {
const avg = data[i] * 0.3 + data[i + 1] * 0.59 + data[i + 2] * 0.11; // Grayscale
const binarized = avg < 126 ? 0 : 255;
const binarized = avg <= 90 ? 0 : 255;
data[i] = binarized;
data[i + 1] = binarized;
data[i + 2] = binarized;
Expand Down

0 comments on commit 8c1f86e

Please sign in to comment.