Skip to content
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

Update images.py #14963

Closed
wants to merge 1 commit into from
Closed

Update images.py #14963

wants to merge 1 commit into from

Conversation

chiragn888
Copy link

The flatten function has been updated with a conditional check to see if the image has an "RGBA" mode, meaning it contains an alpha channel for transparency. If that is the case, it flattens the image by creating a new solid background image with the specified background color and pasting the original image onto it, using the original image itself as the mask to retain its alpha transparency. Finally, the function returns the modified image converted to "RGB" mode with no transparency.

The `flatten` function has been updated with a conditional check to see if the image has an "RGBA" mode, meaning it contains an alpha channel for transparency. If that is the case, it flattens the image by creating a new solid background image with the specified background color and pasting the original image onto it, using the original image itself as the mask to retain its alpha transparency. Finally, the function returns the modified image converted to "RGB" mode with no transparency.
@chiragn888
Copy link
Author

pull request to master branch

@chiragn888 chiragn888 deleted the patch-1 branch February 19, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant