Working with Gigapixel Images (Very large files!)

sleeplesswaves's icon

I've been using:

jit.qt.movie
jit.rota

to load and then scale image files. It's working fine for small images, however, I'd like to load images 20MB or even up to 500MB with very high resolution so I can essentially zoom in and out with little quality loss. I've tried loading an image 20MB and it hangs and the output window just stays black.

Anyone have ideas for working with large files like this?

Thanks!

sylvain's icon

Processing images like that will take some cpu i guess, it might be better to process in GL directly instead of using jit.rota (so rotating/scaling an jit.gl.videoplane and rendering it to a window directly).

For the reading part: have you tried 'asyncread' instead of 'read' ? That should prevent from the entire patch from responding. I have no idea how this will work with big image-files, but worth a try. The object will send a message from the info outlet once it is done.

bijective's icon

I am also trying to open very high resolution images (<10MB) at which point jit.movie hangs and Max 7 crashes consistently. What are the resolution limitations when reading images into jit.movie ?

LSka's icon

are you running Max in 64bit mode?
How much RAM do you have?

bijective's icon

Okay looks like I had 32-bit mode enabled in the Get Info panel for the Max 7.app in macOS. I have 16 GB of RAM.

Now at least Max 7 won't crash when loading an image that is e.g. 7MB but even so, Max still slows to a crawl once it's loaded.

Also, as QuickTime is not supported in 64-bit mode, I switched to viddll engine in preferences and restarted Max, and notice now that jit.movie does nothing when sending usesrcrect 1 to the object, which is the crux of this inquiry.

tmhglnd's icon

Instead of using [jit.movie] you can also load your image in a [jit.gl.texture] with the (read) message.

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

bijective's icon

It seems that even with 64-bit enabled and loading the large image (jpg/png) into a texture on the GPU, Max 7 without fail crashes when [read] images approaching 30000 x 30000 pixels.

Rob Ramirez's icon

i would use some external software to split up the image into chunks that can be read into multiple jit.matrix/jit.movie/jit.gl.texture objects (the image handling backend for all these objects is the same), and then stitch back together using multiple gl.videoplanes and an anim.node hierarchy to adjust the view.

Jitter has no special functionality for managing these large images.