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
Jpeg quality 95 by default with rendering with PIL #1771
Conversation
When a font doesn't have a glyph name, we should synthesize. This fixes the Arial font problems under Windows 8.
👍 from me. I don't think disk space or bandwidth are at such a premium that this doesn't make sense as a default. |
Why not have a |
@pelson: Good suggestion. |
On the above commit; I'm not sure what the best practices are when dealing with rcParams (as far as whether to assume the entry is always there, and provide an initialization for it (savefig.jpeg_quality), or to use rcParams.get() as I have in the commit. Also should the parameter be named savefig.pil_jpeg_quality or something like that, to indicate that it's only used for PIL? |
The rcParam should be defined in As for the name -- it would be nice to fix up all of the backends that write jpegs to support this (it looks doable, just a matter of working through all the various APIs), so I'd be in favor of calling it |
On the above commits:
|
if 'quality' not in options: | ||
options['quality'] = rcParams['savefig.jpeg_quality'] | ||
options['quality'] = str(options['quality']) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP8: Please use just one newline between blocks of code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean between lines 477 and 478?
@dhyams - looks like you've done most of the hard work. The PR wont merge automatically, so would you mind re-basing. I'd also be interested to hear what pieces of work you think are critical to be done before this PR should be merged. Thanks, |
Bump. I'm keen to get this into v1.3 (~ a months time) |
Sorry; I have been a little bogged down lately and let this one slip. I'll make the requested changes as soon as I can, and rebase. |
Re: pelson on what else needs to be done before this PR is merged: maybe can someone test on gtk and gdk? My current setup precludes the use of these two backends. |
Conflicts: src/ft2font.cpp
…igurable via rcParams.
With a short one-line doc in matplotlibrc.template.
git clone git@github.com:dhyams/matplotlib.git At this point, everything looks OK. git push To git@github.com:dhyams/matplotlib.git Is it correct to do a git push -f |
I usually run the test suite again once the conflicts have been resolved to make sure, but after that, yes, |
What probably happened is that you just did a straight out rebase of a Then, when it is time to rebase a feature branch, I rebase against my local Cheers! On Fri, Apr 19, 2013 at 6:50 PM, Michael Droettboom <
|
I just pushed the rebasing on this one. |
Bump, so that the rebasing doesn't get out of date. Is this one OK to merge? |
Jpeg quality 95 by default with rendering with PIL
Thanks for merging @mdboom - I think the code changes were ready to go & @dhyams was right to encourage a merge before the PR went stale. @dhyams: Given there is a change to the default JPEG quality, and there is a new rcParam, would you mind creating a new PR with the necessary changes to the While you're at it, this PR has introduced a couple of double newlines (one in |
Ok this has been done here: |
Brilliant. Thanks @dhyams! |
This is just my opinion, but when rendering a plot to JPEG, the default quality should be a bit higher. Plots are usually (admittedly not always) full of starkly defined edges, that don't look very good once the jpeg format gets finished artifacting around all of them.
While it's true that a user shouldn't write a jpeg of something that doesn't consist of smoothly varying colors, if they do, let's try to make it look as good as is reasonable.
I've attached two images, one with the 75 quality and one with 95. The 75 quality one was 18K in size, and the 95 quality was 30K in size.