Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information