Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
imsave should preserve alpha channel#1956
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
lib/matplotlib/image.py Outdated
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.
Does thetransparent kwarg on savefig do the same thing? (http://matplotlib.org/faq/howto_faq.html#save-transparent-figures)
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.
You're right, it does. (Silly me, I'd forgotten about that option.)
I've updated the branch to use that instead.
pelson commentedMay 1, 2013
Ah. Unfortunately the travis-ci instance has this test failing:https://s3.amazonaws.com/archive.travis-ci.org/jobs/6792238/log.txt |
Westacular commentedMay 1, 2013
That's because#1868 hasn't been merged. (This hits the same problem that that fixes.) On my test branch with both patches applied, the test passes. |
pelson commentedMay 1, 2013
Doh! Time to go home - its been a long day 😄 |
Westacular commentedMay 2, 2013
Oh, oops. I think I half-botched a rebase of this branch, but the overall diff is still correct. |
pelson commentedMay 3, 2013
I think we only need a single commit for this change, so would you mind going ahead and squashing your changes? if its more trouble than its worth, don't worry about it though. |
Westacular commentedMay 3, 2013
Done (and managed to do it right this time.) |
mdboom commentedMay 3, 2013
👍 --@pelson: I leave it to you to push the green button since you've been following all this closer than I. |
Imsave now preserves the alpha channel.
While looking at test_image, I noticed the comment that
imsavewas flattening alpha channel data. I figured this was related to#1868 (it is, partially), and decided to fix it.I've updated the test to reflect that an imsave/imread round-trip should now preserve full RGBA data to within 1/255.
Passing the test, however, requires that the patches from#1868 also be applied.