Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 166_Ascii_Image/ascii-image-canvas/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));



Expand Down
2 changes: 1 addition & 1 deletion 166_Ascii_Image/ascii-image-dom/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 += " ";
Expand Down
2 changes: 1 addition & 1 deletion 166_Ascii_Image/ascii-video/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down