Aspect ratio correction through matrix processing (no OpenGL)

Pedro Santos's icon

Hi. I need to build thumbnails of images imported through a jit.movie to a fixed jit.pwindow (1:1 ratio for instance).
As the images may differ in aspect ratio from the jit.pwindow, is there an easy solution using matrix processing to generate the thumbnails while keeping its proper aspect ratio and adding horizontal or vertical black bars accordingly?

I'm not talking about jit.gl.videoplane, jit.gl.cornerpin or jit.gl.render manipulation, just straight matrix processing. Has anyone done it before?

Thanks.

Christopher Dobrian's icon

I suggest taking a look at Jitter Tutorial 14: Matrix Positioning. You can use 'dstdimstart' and 'dstdimend' messages to a jit.matrix object to place a video within a desired submatrix of a matrix (in your case, a square matrix).

Max Patch
Copy patch and select New From Clipboard in Max.

Ferenc Fabian's icon

hey Christopher, would it be possible with a jit.gl.texture as well? I tried to recreate it with that, but haven't succeeded yet.
Cheers

Matteo Marson's icon

Hey there,

You can try something like this:

Max Patch
Copy patch and select New From Clipboard in Max.