We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › createGraphics() - max image size
Page Index Toggle Pages: 1
createGraphics() - max image size? (Read 1546 times)
createGraphics() - max image size?
Mar 9th, 2009, 8:52pm
 
Greetings, and apologies for a very basic question:

My understanding is that createGraphics() can be used to create images larger than the screen resolution of the system I am running Processing on.

What is max image size which createGraphics() can generate, and what does this depend on ( type of image, RAM on my system, OS version, type of computer, etc.)?

Specifically, I want to see if I can create 32000x8000 images which correspond to the full resolution of HIPerSpace display wall at Calit2 where my lab is located. I have been working with imageJ and on my PowerBook which 2 MG RAM I can create appr. 32000x4000 8-bit max.

Thanks in advance,

Lev Manovich
Re: createGraphics() - max image size?
Reply #1 - Mar 9th, 2009, 10:42pm
 
I don't know, but it seems like it would be easy enough for you to just try it and find out...
Re: createGraphics() - max image size?
Reply #2 - Mar 10th, 2009, 12:57am
 
Thanks! I can certainly try this - but if the max size depends on RAM, OS type and other software/hardware issues, the answer I will arrive at will be specific to one particular machine (my laptop). This is why I am hoping if people who have explored this have some more general observations.

Casey or Ben - any ideas? Lev
Re: createGraphics() - max image size?
Reply #3 - Mar 10th, 2009, 1:54pm
 
Simple math: 4*32000*8000/1024/1024 = 976MB
4 = 4 bytes per pixel (RGBA)

Problem: there is an unknown factor when using Processing, eg. double-buffering will use twice this memory (but should apply only to display?), intermediary buffers can be used, etc.
People have observed that when loading a bunch of images, Processing exhausts memory faster than computed.
Some limitations to be aware of.
Re: createGraphics() - max image size?
Reply #4 - Mar 10th, 2009, 6:30pm
 
Even so, 976 MB is not outside of the realm of the achievable, even if doubled.  Seems like a box tricked out with enough ram and O/S settings that actually let a single process have 2 or 4GB of ram would get the job done.

I think that a larger factor affecting performance in that scenario is going to be bandwidth: memory bandwidth of being able to read/write to the full 976 MB worth of pixels at any kind of frame rate whatsoever, and also the bandwidth of transmitting 976 MB per frame from ram to the video card.

Theoretically, such a sketch ought to _work_, I'm just skeptical that it can do so at decent frame rates.
Re: createGraphics() - max image size?
Reply #5 - Mar 11th, 2009, 4:23am
 
Thanks! I was not even thinking of an interactive sketch - just a program which allocates memory, calculates an image and writes it to a flle without ever having to display it on the screen.

I got imageJ (open source image processing software) to create 32000x8000 9-bit image (not full color - but thats good enough for many graphics possibilities).
Page Index Toggle Pages: 1