Re: NG save method [message #83476] |
Fri, 08 March 2013 09:34 |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
On Thursday, March 7, 2013 4:35:31 PM UTC-7, mark...@gmail.com wrote:
> I have a question on the save method when using new graphics.
>
>
>
> I've been creating a large number of small plots using NG and while the performance of the plot routine is ok, saving the image to a PNG file seems relatively slow. The degradation in speed is barely noticeable for a single image but starts to become obvious when you're creating many images.
>
>
>
> Is there anything I can do to speed this process up eg use JPG instead of PNG? Use a lower resolution? Crop borders to reduce image size? Use /transparent to reduce the number of colours?
>
>
>
> IDL 8.2.2 supposedly improves the performance of NG - dies anyone know if the save performance is also improved?
>
>
>
> Mark
Hi Mark,
By default, when you save to an image file format (png, jpeg, gif, etc) with new graphics, it saves the image at a resolution of 600 dpi. This is so your image will look nice if it is embedded within a paper or send to a printer.
If you don't need such high resolution, then I would just set the resolution keyword:
p = plot(/test, title='Mass [$M_{\odot}$]')
tic
p.Save, 'myplot.png', RESOLUTION=300
toc
On my Windows 7 laptop, the save takes about 0.7 seconds. If you are just sending the plot to Powerpoint or a webpage, then you could lower the resolution even further.
Hope this helps!
Cheers,
Chris
ExelisVIS
|
|
|