You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Matplotlib version 3.8.0 (and also 3.7.3) installed this is the ouput:
A gif-file with a white background
Expected outcome
In 3.6.3 and before the file had a transparent background
Additional information
I tried many different setups, different values for facecolor (e.g. (1,1,1,1)), set "transparent": True and googeling quite a lot - old solutions on github won't work.
Like in the expected outcome stated, this worked in the past (until Matplotlib 3.6.3).
There either seems to be an error in the fix for another issue in #21831 - or this is now the new correct behavior, but it seems like the transparency should still work for gifs, as this was an issue with different formats.
Operating system
Windows 11
Matplotlib Version
3.8.0
Matplotlib Backend
TkAgg
Python version
Python 3.12.0
Jupyter version
No response
Installation
pip
The text was updated successfully, but these errors were encountered:
Me and two fellow students have been looking into this issue as part of a project.
So far we have found that the fix you mentioned takes alpha and therefore transparency out of the equation. As far as we understand it simulates transparency by scaling the color and making it appear "faded" over a white background. But actually it transforms the rgba value to a rgb value (no transparency).
If you hardcode a rgba value then the previous problem returns (the blocky looks). However only if you don't use ffmpeg and only the pillowwriter.
We think this could be solved by checking which writer is used and only allowing "true" transparency when using ffmpeg and using the previous fix without it.
JakobRing
added a commit
to JakobRing/matplotlib
that referenced
this issue
Nov 30, 2023
Bug summary
Matplotlib is no longer able to create gifs with a transparent background.
Code for reproduction
Actual outcome
With Matplotlib version 3.8.0 (and also 3.7.3) installed this is the ouput:
A gif-file with a white background
Expected outcome
In 3.6.3 and before the file had a transparent background
Additional information
I tried many different setups, different values for facecolor (e.g. (1,1,1,1)), set "transparent": True and googeling quite a lot - old solutions on github won't work.
Like in the expected outcome stated, this worked in the past (until Matplotlib 3.6.3).
There either seems to be an error in the fix for another issue in #21831 - or this is now the new correct behavior, but it seems like the transparency should still work for gifs, as this was an issue with different formats.
Operating system
Windows 11
Matplotlib Version
3.8.0
Matplotlib Backend
TkAgg
Python version
Python 3.12.0
Jupyter version
No response
Installation
pip
The text was updated successfully, but these errors were encountered: