| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Temporarily changing the figure background and manually calculating the alpha-shading towards white is more low-level. It's harder to understand what's going on and it might be more susceptible of introducing bugs in the future.
Is the performance gain worth it?
Sorry, something went wrong.
| FigureCanvasAgg.draw(self) | ||
| if dryrun: | ||
| return | ||
| # The image is "pasted" onto a white background image to safely |
There was a problem hiding this comment.
The comment needs to be adapted.
Sorry, something went wrong.
There was a problem hiding this comment.
well, this is still pasting the figure over a white background.
Sorry, something went wrong.
|
Actually, another motivation for the change is to make buffer_rgba() return an array that can be directly passed to imsave() -- essentially doing the same thing as in #15435, but for jpeg. |
Sorry, something went wrong.
| over *quality*, *optimize* and *progressive*. | ||
| """ | ||
| FigureCanvasAgg.draw(self) | ||
| # The image is "pasted" onto a white background to handle transparency. |
There was a problem hiding this comment.
I think the term "paste" is a bit misleading
| # The image is "pasted" onto a white background to handle transparency. | |
| # Remove transparency by alpha-blending on an assumed white background |
Sorry, something went wrong.
There was a problem hiding this comment.
sure, sounds good, edited accordingly
Sorry, something went wrong.
We can compose the figure facecolor against a white background before rendering the image, rather than after. This saves an image composition step.
|
Will this cause weird flickering on interactive views (maybe not regular figures that composite on white, but embedded/notebook/something else)? |
Sorry, something went wrong.
|
I'm not sure why it would? |
Sorry, something went wrong.
|
I was thinking of stuff like changing the DPI, but I see setting the canvas manager is handled in the call stack above this one. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
We can compose the figure facecolor against a white background before
rendering the image, rather than after. This saves an image composition
step.
PR Summary
PR Checklist