large render problem

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
xdamon
Posts: 7
Joined: Fri Mar 14, 2008 5:47 pm

large render problem

Post by xdamon »

hello,
i'd like to be able to render the images in very big sizes,
(something like 64000x64000 or more)
but when i try to do that, the following message appears :
===
Microsoft Visual C++ Runtime Library
Runtime Error!
Program : ... ContextFree.exe

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
===
this happens for example on the welcome.cfdg with values like
24000x24000
i also tried the beta version, and the same thing happens ...

what can i do ?

have a nice day,
xavier.

xdamon
Posts: 7
Joined: Fri Mar 14, 2008 5:47 pm

Post by xdamon »

sorry, it's pretty late here (France), and in the previous post,
i forgot to tell you how much i love your software.
i discovered it 3 days ago, and have not been sleeping much ... :)

cheers,
xavier.

User avatar
mtnviewmark
Site Admin
Posts: 81
Joined: Wed May 04, 2005 12:46 pm
Location: Mountain View, CA
Contact:

Post by mtnviewmark »

Let's do a little math:

Color:
64,000 x 64,000 x 4 bytes/pixel = 15 GiBytes
24,000 x 24,000 x 4 bytes/pixel = 2.1 GiBytes

Greyscale:
64,000 x 64,000 x 1 bytes/pixel = 3.8 GiBytes
24,000 x 24,000 x 1 bytes/pixel = 0.5 GiBytes

Most personal computers can have at most 2 or 4 GiBytes of memory. And even while some can have more, given the 32-bit processors that they use (and Context Free is compiled for), a program can address no more than 4 GiBytes.

So, the first one is just right out. The second one might be possible... But, all operating systems don't allow a program to allocate all of the possible 4 GiBytes of address space. How much depends on many factors, but as you've seen, that is still too big under your Windows configuration.

Chris Coyne and I have successfully generated 32,000 x 32,000 greyscale images (on Linux and Macintosh), which take approx. 1 GiByte. But beware, you need about twice that memory to successfully generate and save as PNG. If you have less, then the swapping to disk will likely make image generation take forever.

If you had a 64-bit CPU, and a 64-bit operating system, you could take the source and recompile it for 64-bit. We suspect it will just work. But you'd still need a lot of memory to generate the image.

Now - 64,000 @ 300dpi is almost 5.5m! What are you planning on doing with a high-resolution image over 5m x 5m????? Inquiring minds want to know!
I'm the "m" in "mtree.cfdg"

xdamon
Posts: 7
Joined: Fri Mar 14, 2008 5:47 pm

Post by xdamon »

thank you for your quick response ! :)

i now understand ...

i wanted to print at 600 dpi because of very very thin lines that i wanted to render.
since i can't render at more than 16000x16000 (from what i experimented)
the maximum size i would have would be 67cm x 67cm ... and i wanted to print something in the 150cm range ...
which would mean something like 36000 x 36000
maybe i am thinking the wrong way with the 600 dpi ?

another thing i don't understand is that (if i remember correctly) some images will render at resolutions a little bit bigger while some other image will make the program crash.
would there be a way to have the program tell you that the resolution your are trying is too big for that image so that the user could play around with the numbers until he can render with the maximum resolution for that image ?

or maybe, is there a way i could render in svg and then import it into photoshop and generate the image ?

thank you very much for your time and patience ! :)

xavier.

xdamon
Posts: 7
Joined: Fri Mar 14, 2008 5:47 pm

Post by xdamon »

by the way, how do you specify that you want to generate the image in gray scale ? can you only do this with the command line ? i don't have a compiler, so is there a way to download the command line version from somewhere ?

and if there is only one byte per pixel in a gray scale, does that mean that there is no transparency ?

xavier.

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

If your cfdg file specifies an opaque background and never uses hue or sat then Context Free will generate an 8-bit gray-scale image. The 8-bit format supports transparency as long as the background is opaque (the default background is opaque white).

You can get the Windows command-line version from this zip file: http://www.contextfreeart.org/download/ ... .2beta.zip. Just unzip is somewhere and run the ContextFreeCLI program

xdamon
Posts: 7
Joined: Fri Mar 14, 2008 5:47 pm

Post by xdamon »

thank you very much for the compiled command line version and for your response about the gray scale. if i understand correctly, i can not have a transparent background and be in grayscale mode ... is that right ?
is there a way to do this ? if not, no worries, i just would like to know/understand.

i have another question ...
is there a way to make sure the rendering of the final images always have the same scale ?
i mean, i have this random function, and sometimes, it produces a big image, and sometimes a small one. i would like the basic shapes in both images to always be the same size.
i found a way, but it is not very satisfying :
i draw 4 little squares defining a big box around my image, but the problem is that my image sometimes goes out of the box, and then the scaling changes again ... also, drawing a big box prevents me from seeing what the actual image looks like before i "render to size"

would there be a way of knowing how much the image has been scaled so that we could calculate what the final image size needs to be to always have the same size for the basic shapes ?

sorry if i am not clear, english is not my native tongue, i am french ...

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

xdamon wrote:thank you very much for the compiled command line version and for your response about the gray scale. if i understand correctly, i can not have a transparent background and be in grayscale mode ... is that right ?
is there a way to do this ? if not, no worries, i just would like to know/understand.
If you have a transparent background then you need a pixel format with an alpha channel. The AGG graphics library that we use to generate output does not have a gray-scale format with alpha. It only has a color format with alpha. It is possible to add support for gray-scale with alpha by modifying the existing color pixel format code to be gray-scale instead of color, but it would be a lot of work.

There is also the problem that neither Windows nor Mac OS X support a gray-scale with alpha pixel format. So even if we added that capability to Context Free it would only work on the Unix command-line version of Context Free, not on the Windows or Mac versions.
xdamon wrote:i have another question ...
is there a way to make sure the rendering of the final images always have the same scale ?
i mean, i have this random function, and sometimes, it produces a big image, and sometimes a small one. i would like the basic shapes in both images to always be the same size.
i found a way, but it is not very satisfying :
i draw 4 little squares defining a big box around my image, but the problem is that my image sometimes goes out of the box, and then the scaling changes again ... also, drawing a big box prevents me from seeing what the actual image looks like before i "render to size"

would there be a way of knowing how much the image has been scaled so that we could calculate what the final image size needs to be to always have the same size for the basic shapes ?

sorry if i am not clear, english is not my native tongue, i am french ...
We added a feature to Context Free that does what you want but it is disabled in the release builds. The feature was requested by a graduate student who was using Context Free in his research project. I will compile the command line version with the feature enabled and post it here (but not tonight, it is late).

xdamon
Posts: 7
Joined: Fri Mar 14, 2008 5:47 pm

Post by xdamon »

wow ! thank you very much !

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

I have placed a new version of ContextFreeCLI.exe at this url: http://www.contextfreeart.org/download/ ... reeCLI.exe Copy it into the same directory that you unzipped the stand-alone version of Context Free. This version of Context Free enables the size directive. You can put a size directive at the top of your cfdg file, next to startshape and background. The size directive looks like this:

size {s width height x x-shift y y-shift}

When your cfdg file has a size directive then the bounding box for the output canvas is determined by the size directive. Otherwise, the bounding box is computed to include everything that your cfdg file draws.

The reason that we haven't enabled the size directive for the release builds is that we feel that it is very restrictive. We want to create a more flexible solution for controlling the canvas bounding box.

xdamon
Posts: 7
Joined: Fri Mar 14, 2008 5:47 pm

Post by xdamon »

thank you very much for your help !

just my two cents, i think you should leave the possibility of this directive in the builds, and people can use it or not ... unless there is an incompatibility with something else ?

also, i don't know if it is a lot of work, but i think a bounding box that would automatically shift itself to include the whole drawing (if it fits) would really be useful (if the whole drawing does not fit than the bounding box could stay at it's original position or center itself, but not resize itself)
as i previously said, i don't know if it is a lot of work, and given the fact that the student and i are the only people who ever asked for it ... :)

i just realized you're in mountain view, i now live in Paris, but have lived for 2 years in the bay area (redwood city) what a nice area !!!

anyway, you guys rock, i just made a donation to eff ...

again, thank you and keep up the good work.

cheers ...

Post Reply