8000 Jpeg quality 95 by default with rendering with PIL by dhyams · Pull Request #1771 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Jpeg quality 95 by default with rendering with PIL #1771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 23, 2013
Prev Previous commit
Next Next commit
Added savefig.jpeg_quality to the rcParams correctly
With a short one-line doc in matplotlibrc.template.
  • Loading branch information
Daniel Hyams committed Apr 19, 2013
commit e1c237848ff0a0f366da123cda8dbd582df1e042
2 changes: 1 addition & 1 deletion lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,7 @@ def print_jpg(self, filename_or_obj, *args, **kwargs):
'progressive'])

if 'quality' not in options:
options['quality'] = rcParams.get('savefig.jpeg_quality',95)
options['quality'] = rcParams['savefig.jpeg_quality']

return image.save(filename_or_obj, format='jpeg', **options)
print_jpeg = print_jpg
Expand Down
1 change: 1 addition & 0 deletions lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ def __call__(self, s):
'savefig.frameon': [True, validate_bool],
'savefig.orientation': ['portrait', validate_orientation], # edgecolor;
#white
'savefig.jpeg_quality': [95, validate_int],
# what to add to extensionless filenames
'savefig.extension': ['png', deprecate_savefig_extension],
# value checked by backend at runtime
Expand Down
17 changes: 9 additions & 8 deletions matplotlibrc.template
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,15 @@ text.hinting_factor : 8 # Specifies the amount of softness for hinting in the
# the default savefig params can be different from the display params
# e.g., you may want a higher resolution, or to make the figure
# background white
#savefig.dpi : 100 # figure dots per inch
#savefig.facecolor : white # figure facecolor when saving
#savefig.edgecolor : white # figure edgecolor when saving
#savefig.format : png # png, ps, pdf, svg
#savefig.bbox : standard # 'tight' or 'standard'.
#savefig.pad_inches : 0.1 # Padding to be used when bbox is set to 'tight'
#savefig.directory : ~ # default directory in savefig dialog box,
# leave empty to always use current working directory
#savefig.dpi : 100 # figure dots per inch
#savefig.facecolor : white # figure facecolor when saving
#savefig.edgecolor : white # figure edgecolor when saving
#savefig.format : png # png, ps, pdf, svg
#savefig.bbox : standard # 'tight' or 'standard'.
#savefig.pad_inches : 0.1 # Padding to be used when bbox is set to 'tight'
#savefig.jpeg_quality: 95 # when a jpeg is saved, the default quality parameter.
#savefig.directory : ~ # default directory in savefig dialog box,
# leave empty to always use current working directory

# tk backend params
#tk.window_focus : False # Maintain shell focus for TkAgg
Expand Down
0