Is there a way to speed up the saving of a figure in jpg format in nodisplay mode ?
Show older comments
I'm trying to save a figure as a jpg on a server without display.
The ''saveas'' function takes about 10s to save as jpg for image of ~200ko.
At first, I tried to save the image with another function like print but it's the same. (I think it might be a problem with writing to my disk, but after some tests I realised it wasn't that).
In the second part, I did some tests and played with the figure setting options like Visible, renderer... to finally understand that it is the renderer that is very slow, because in nodisplay mode, opengl cannot be used and the painters renderer is used. (opengl info gives a blank result). Testing the same code in matlab with display and set opengl renderer, it takes about 1s and with painters renderer, it takes about 10s. Why is there a big difference in time between opengl and painters renderer?
Is there a way to save the figure as an image faster in the matlab code?
Alternatively, maybe the solution is to use a tool unrelated to the matlab code to access an opengl renderer when running matlab?
I found out that we can use a virtual X server with xvfb to run matlab in display mode and use it to 'emulate' an opengl renderer, does this work well ?
Can we install a mesa3d tool on the server to use an opengl renderer without a graphics card or display for matlab?
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!