PGraphics Output Doesn't... (large pngs)

edited August 2016 in Using Processing

Hi folks, My story is that I am running P302 on Ubuntu Linux. I have a sketch that outputs a PGraphics object in PNG format no problem. The other day I upped the size of the PNG output to 10x7K. The program ran the same as always (no error messages) but the output file simply wasn't there. Dropping back to a smaller size, the output file was written to disk. Going back to the 10x7K size - program runs normally but no output file on disk.

I then changed my output file format from PNG to TIF and the output file was output!

So my two questions are:

1) Have others experienced problems saving large PGraphics objects as PNGs?

2) Is there a way I can discover what is going on under the covers in the creation of PNG output such that it fails but produces no error message in the console? Note I haven't tried a try/catch but as the statement appears to run normally (no error messages and program execution continues normally) I'm betting try/catch wouldn't tell me anything.

Thanks.

Answers

  • You may be hitting issues with asynchronous image saving that was turned on by default between 3.0 and 3.1.1. It'll take a while to write a 10k x 7k file as a PNG since it has to compress the whole thing.

    Try using Processing 3.2 (or 3.1.2), or use hint(DISABLE_ASYNC_SAVEFRAME) to see if that helps.

    If not, I'd also try specifying another image type, TIFF in particular might give you better results—it's a really simple encoder that doesn't do (much) compression. If that works, that'll help isolate the problem.

  • Hi, I'll try using the hint() code. I know I should upgrade but just haven't gotten around to it (I'm still using v2 on my Windows machine). PS - it was nice meeting you at Eyeo.

Sign In or Register to comment.