Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

CAUTION/Disclaimer: execution of some of the code below can result in a complete crash of Mathematica or even your system. Save all your work and do not try in a productive situation.

For a graphical application, I need to export graphics containing several hi-res textures at large image sizes.

Consider the following (minimal example) code wich is largely harmless:

Graphics[{Texture[Graphics[Circle[]]], 
  Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, 
   VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}, 
 ImageSize -> 400]

But upping ImageSize past a given (probably hardware-dependent, in my case ~4000) threshold will crash the frontend+kernel

Graphics[{Texture[Graphics[Circle[]]], 
  Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, 
   VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}, 
 ImageSize -> 4000]

To make things worse, this also seems to depend on the graphics driver version. I use a NVIDIA GTX 485M card, and with the 296.10 driver, I can go up to about ImageSize -> 8000 while with any newer driver version the system stalls at ImageSize -> 4000.

Does anyone know a workaround? Always reverting to an obsolete driver (which e.g. does not work with CUDALink anymore) is not optimal.

Addendum: Question, Part Two

As pointed out by @cormullion, setting the global preferences for the antialiasing quality in the Preferences dialog helps already a lot and allows much larger ImagesSizes.

Now, how to go about setting/resetting the value of HardwareAntialiasingQuality programmatically?

share|improve this question
    
What's your Antialiasing preference set to? I had more frequent crashes with this set to medium or high, but far fewer when set to lowest. –  cormullion Feb 4 '13 at 8:50
    
@cormullion Cool - setting Antialiasing to None in the Preferences dialog helps working with much larger sizes. Please consider an answer. –  Yves Klett Feb 4 '13 at 9:17
    
Since you were the last to pipe up on meta, I'm using your question as a guinea pig to test out the new close options =) Brace yourself for a close storm and/or additional comments :D –  rm -rf Jun 26 '13 at 18:45
add comment

1 Answer

up vote 4 down vote accepted

I've had problems when pushing images above a certain size. For example, it's ok at 1500:

DensityPlot[Sin[x] Sin[y], {x, -4, 4}, {y, -3, 3}, 
  ColorFunction -> "SunsetColors", ImageSize -> 1500]

ok plot

But pushing it too far:

DensityPlot[Sin[x] Sin[y], {x, -4, 4}, {y, -3, 3}, 
  ColorFunction -> "SunsetColors", ImageSize -> 2000]

not ok plot

While I quite like the effect, in an artistic kind of way, clearly Mathematica is reaching into regions of the computer's memory that it shouldn't be. I can see glimpses of other apps, previously opened documents, and so on. (This was a fresh kernel.)

I've had this on versions 8 and 9, and was about to conclude that my computer was going wrong. However, on a hunch, I reset the Antialiasing prefs from Highest down to No Antialiasing, and now the problem doesn't occur very often.

prefs

I must have set it to High for some reason, and forgot that larger images would probably stress it too much.

Your problem may be related!

share|improve this answer
    
What would be the most convenient way to locally turn off antialiasing without resorting to the preferences menu? –  Yves Klett Feb 4 '13 at 9:48
2  
@yves FrontEnd Options contains "RenderingOptions -> {"HardwareAntialiasingQuality" -> 0.}", perhaps you can explore that? –  cormullion Feb 4 '13 at 10:01
    
Correct - I just cannot remember the correct way to set that option (if I ever knew that firstplace). Thought it was around, but cannot find it. –  Yves Klett Feb 4 '13 at 10:23
    
What OS do you see this happen on ? –  rcollyer Feb 4 '13 at 14:51
    
@rcollyer I'm on Mac –  cormullion Feb 4 '13 at 16:20
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.