| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Thanks for submitting this, it looks like a good improvement! A couple of things that need to be fixed:
There's lots of information that should cover the above at http://matplotlib.org/devel/index.html - let us know if you need any help with anything though. |
Sorry, something went wrong.
| hid_output = output | ||
| output = np.ma.masked_array( | ||
| hid_output[..., 0], hid_output[..., 3] < 0.5) | ||
| hid_output[..., 0], hid_output[..., 3] == 0) |
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, this line is indeed causing the problem. In particular, the alpha channel is interpolated near the boundary of an image. The < 0.5 implementation will set pixels that are "more than half transparent" to fully transparent whereas the == 0 implementation only treats them as masked if they are fully transparent.
In short, the boundaries in a few tests differ slightly.
I believe the == 0 implementation is preferable because it effectively provides anti aliasing on the boundary by restoring the alpha channel. Here is a zoomed-in example.
Sorry, something went wrong.
There was a problem hiding this comment.
Hm, but this causes trouble if there are bad data in image. For example, bad values in one of the tests are shown as blue. If we restore the alpha channel, all bad blue values will become transparent. As a compromise, I have rerendered the problematic images (changes only occur at the boundary) and I only restore the alpha channel if _array_alpha is given.
Sorry, something went wrong.
|
I have to run to dinner, but I suspect the ==0 change is what is breaking the tests, which should be pulled out into it's own PR and put (with re-rendering the tests) on 2.0.x. |
Sorry, something went wrong.
|
Please rebase instead of merging, and don't make extra empty commits just to trigger CI. |
Sorry, something went wrong.
|
FYI, we (members of the matplotlib organisation) can manually trigger CI if needed, and you should be able to manually trigger it on your own fork. |
Sorry, something went wrong.
|
Ok, will do that in the future. |
Sorry, something went wrong.
|
Please leave this one for me to review / merge. |
Sorry, something went wrong.
|
This looks useful, but fell under the radar. @tillahoffmann do you have the bandwidth to rebase, and we can try and resurrect? If no one touches it for a while, please ping (and re-ping). Sorry for the lack of response here. |
Sorry, something went wrong.
|
Will close this one and send a new PR because the implementation has changed enough to make a new implementation easier. |
Sorry, something went wrong.
|
Don’t be shy at harassing us |
Sorry, something went wrong.
|
🐑 I thought this had gone in already! This one is definitely on me... |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR allows the alpha argument of imshow to be an array with shape matching the image to support pixel-by-pixel opacity.