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

RGBa to RGB color conversion mapping #6707

Closed
wants to merge 1 commit into from

Conversation

bigcat88
Copy link
Contributor

@bigcat88 bigcat88 commented Oct 31, 2022

Fixes #6706

Added mapping for RGBa to RGB conversion

@bigcat88 bigcat88 changed the title Fixes #6706 RGBa to RGB color conversion mapping. Fixes #6706 Oct 31, 2022
@radarhere radarhere changed the title RGBa to RGB color conversion mapping. Fixes #6706 RGBa to RGB color conversion mapping Oct 31, 2022
@radarhere
Copy link
Member

RGBa is "true color with premultiplied alpha". In main, converting from RGBA to RGBa makes the RGB values smaller

>>> from PIL import Image
>>> im = Image.new("RGBA", (1, 1))
>>> im.putpixel((0, 0), (150, 175, 200, 100))
>>> im.convert("RGBa").load()[0, 0]
(59, 69, 78, 100)

so converting to RGB should make the RGB values bigger again, yes? Your test shows the RGB values getting smaller.

I've created #6708 instead.

@bigcat88 bigcat88 closed this Oct 31, 2022
@bigcat88 bigcat88 reopened this Oct 31, 2022
@bigcat88 bigcat88 closed this Dec 28, 2022
@bigcat88 bigcat88 deleted the RGBa-to-RGB-conversion branch December 28, 2022 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

convert("RGB") fails for RGBa
2 participants