#downscaling video in p5js

14 messages · Page 1 of 1 (latest)

dense ginkgo
#

downscaling video in p5js

vast storm
#

Can you share the code, so we see what you have tried and where the problem is?

dense ginkgo
#

i will send and @ u later tonight :)

dense ginkgo
#

@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]) ```
vast storm
#

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();
  ...
dense ginkgo
#

@vast storm all good mate!

#

appreciate the response regardless

#

delved into this rabit hole of opening up two div containers two run 2 p5 sketches

#

one for my ml

#

one for the ascii art

#

the ascii stuff requires a no canvas sketch