Skip to content

Delete transparency info when img.convert'ing RGB/L to RGBA - #2633

Merged
wiredfool merged 1 commit into
python-pillow:masterfrom
olt:delete-rgb-transparency
Aug 31, 2017
Merged

wiredfool merged 1 commit into
python-pillow:masterfrom
olt:delete-rgb-transparency

Conversation

@olt

@olt olt commented Jul 18, 2017

Copy link
Copy Markdown
Contributor

info['transparency] was not removed when an RGB or L image
was converted to RGBA. This could result in unexpected behavior
when saving the resulting image.

Other image conversions already delete or update the transparency
info. There is a shortcut for RGB/L to RGBA which missed this.

info['transparency] was not removed when an RGB or L image
was converted to RGBA. This could result in unexpected behavior
when saving the resulting image.

Other image conversions already delete or update the transparency
info. There is a shortcut for RGB/L to RGBA which missed this.
@homm

homm commented Aug 9, 2017

Copy link
Copy Markdown
Member

This could result in unexpected behavior when saving the resulting image.

While in general this looks good, could you provide simple example with code which leads to unexpected behavior.

@homm

homm commented Aug 26, 2017

Copy link
Copy Markdown
Member

@olt I'd like to see this in the further version, but also I'd like to know what exactly the issue is. Could you provide an example of unexpected behavior?

@wiredfool

Copy link
Copy Markdown
Member

I think this is roughly the same issue as #2702. RGBA images shouldn't have any transparency or palette info, as all of information that should affect the image interpretation is in the pixels themselves. (excepting color profiles. but that's a different can of worms).

@wiredfool
wiredfool merged commit f4c56a7 into python-pillow:master Aug 31, 2017
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.

3 participants