diff --git a/166_Ascii_Image/ascii-image-canvas/sketch.js b/166_Ascii_Image/ascii-image-canvas/sketch.js index 25b1992..a641de3 100644 --- a/166_Ascii_Image/ascii-image-canvas/sketch.js +++ b/166_Ascii_Image/ascii-image-canvas/sketch.js @@ -40,7 +40,7 @@ function draw() { //square(i * w, j * h, w); const len = density.length; - const charIndex = floor(map(avg,0,255,len,0)); + const charIndex = floor(map(avg,0,256,len,0)); diff --git a/166_Ascii_Image/ascii-image-dom/sketch.js b/166_Ascii_Image/ascii-image-dom/sketch.js index d1fb9b8..74c8a91 100644 --- a/166_Ascii_Image/ascii-image-dom/sketch.js +++ b/166_Ascii_Image/ascii-image-dom/sketch.js @@ -32,7 +32,7 @@ function setup() { const avg = (r + g + b) / 3; const len = density.length; - const charIndex = floor(map(avg, 0, 255, len, 0)); + const charIndex = floor(map(avg, 0, 256, len, 0)); const c = density.charAt(charIndex); if (c == " ") row += " "; diff --git a/166_Ascii_Image/ascii-video/sketch.js b/166_Ascii_Image/ascii-video/sketch.js index aae40fa..fcc6e2d 100644 --- a/166_Ascii_Image/ascii-video/sketch.js +++ b/166_Ascii_Image/ascii-video/sketch.js @@ -33,7 +33,7 @@ function draw() { const b = video.pixels[pixelIndex + 2]; const avg = (r + g + b) / 3; const len = density.length; - const charIndex = floor(map(avg, 0, 255, 0, len)); + const charIndex = floor(map(avg, 0, 256, 0, len)); const c = density.charAt(charIndex); if (c == " ") asciiImage += " "; else asciiImage += c;