When you call savefig(), you can pass "quality", "optimize" and 
"progressive", as defined in the print_jpg docstring:

         def print_jpg(self, filename_or_obj, *args, **kwargs):
             """
             Supported kwargs:

             *quality*: The image quality, on a scale from 1 (worst) to
                 95 (best). The default is 75. Values above 95 should
                 be avoided; 100 completely disables the JPEG
                 quantization stage.

             *optimize*: If present, indicates that the encoder should
                 make an extra pass over the image in order to select
                 optimal encoder settings.

             *progressive*: If present, indicates that this image
                 should be stored as a progressive JPEG file.
             """

Mike

On 09/05/2011 01:21 PM, Frank Breitling wrote:
> Hi,
>
> I am using matplotlib.savefig to save my figures as JPEG files.
> Now I need to reduce the JPG compression ratio.
> How can I do this?
>
> Any hint is appreciated.
>
> Frank
>
> ------------------------------------------------------------------------------
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA


------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to