-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
As discussed in #66, it would be great to detect when a transparent channel is fully opaque and remove it before saving the new image.
This speeds up encoding while decreasing file size by around 10%.
Implementing this feature would essentially be:
from PIL import Image
image = Image.open(original_filename)
if image.mode == 'RGBA':
colors = image.getchannel('A').getcolors()
if len(colors) == 1 and colors[0][1] == 255:
image = image.convert('RGB')
image.save(destination)
Metadata
Metadata
Assignees
Labels
No labels