I'm a new user of processing. I tried to find the answer to my question in the forum but I was not able to.
I will try to expose clearly what I'm trying to do: Inputs of my program are: - a canvas expressed in a file and loaded as a matrix (2 dimensional array) each cell contains 0 or 1. Each cell will be 180x180 pixel wide in the final image. The canvas contains 888 '1'. - a small image (180x180 pixels) as a png file because of transparency needs - a background image (the large one, could be 6000x9000 pixel or bigger) as a jpg file
What I would like to get as output is the background image with the small image printed everywhere the canvas contains a '1'.
The goal is to print a 180 pdi image with a shape depending on the original canvas. So can be diffrent but it will end up being a 1500x1000mm picture approximately. So a big image. I'm not trying to display it just to dump it into a file.
My problem is that I'm not able to load the background image using PImage. I tried to increase the memory in the preference up to 2018Mo (more does not work on my laptop with 4Go of Ram).
There was always issues with large images in Processing. Java is quite memory hungry, and restrictive at the same time, at least with the 32bit version. The 64bit version, perhaps in server mode, might have less issues (with memory; there are issues with native libraries, sometime).
I still have a good old 32bit Java (on Windows 7 64bit), and I was able to load such image with Processing 1.5. A 6000x9000 pixel image uses approximatively 205MB (counting 4 bytes per pixel; if really using 24bit colors, it should be 154MB), so it is reasonable by modern standards. I tried to up the PDE memory to 512 but I got an OOM exception. With 1024KB, I was able to load the image (some random image I just resized and saved to Jpeg format). Note also that some processes, like decompressing the Jpeg data, can eat more memory than just the storage of the final data. That might explain why we need memory to be nearly three times the image, and I haven't used stuff like loadPixels that increase the memory usage!
In short, perhaps try to use a 64bit Java... And report your progress here, please, I am sure this interest lot of people.