-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
proposed fix for transparency issue #27173 #27406
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -1079,7 +1079,11 @@ def func(current_frame: int, total_frames: int) -> Any | |||
|
||||
def _pre_composite_to_white(color): | ||||
r, g, b, a = mcolors.to_rgba(color) | ||||
return a * np.array([r, g, b]) + 1 - a | ||||
if type(writer) == PillowWriter: | ||||
print("no true transparency using pillow") | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
return a * np.array([r, g, b]) + 1 - a | ||||
else: | ||||
return np.array([r, g, b, a]) | ||||
|
||||
savefig_kwargs['facecolor'] = _pre_composite_to_white(facecolor) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given the name of the internal function |
||||
savefig_kwargs['transparent'] = False # just to be safe! | ||||
|
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.
this needs to be addressed