#downscaling video in p5js
14 messages · Page 1 of 1 (latest)
Can you share the code, so we see what you have tried and where the problem is?
i will send and @ u later tonight :)
@vast storm
i also tried in the 2d for loop:
//no videoDS to video.resize() here videoDS was just an array
if(i%10==0&&j%10==0) videoDs.push(video.pixels[pixelIndex]) ```
Sorry, I was a bit busy, but now looked at your code. I think you can try a little hack. Why not make a new image and copy the video data to this image? The image copy method scales automatic when the source region is unequal to the destination region. And then you can use the copy for the ASCII stuff.
...
video.loadPixels()
const frame = new p5.Image(24, 24);
frame.copy(video, 0, 0, video.width, video.height, 0, 0, 24, 24);
frame.loadPixels();
...