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

Fixed converting indexed PIL images to numpy #2881

Merged
merged 1 commit into from
May 19, 2024

Conversation

RunDevelopment
Copy link
Member

Fixes #2816
Fixes #2620

Turns out, when the internet tells you how to convert a PIL image to numpy, they are lying to you. When the PIL image in question uses a color palette (mode=P), then np.array(im) will give you the indexes into the color palette and not the colors. So we have to convert the image first.

@RunDevelopment RunDevelopment changed the title Fixed converting indexed PIL to numpy Fixed converting indexed PIL images to numpy May 19, 2024
@joeyballentine joeyballentine merged commit a9c6e50 into chaiNNer-org:main May 19, 2024
14 checks passed
@RunDevelopment RunDevelopment deleted the issue2620 branch May 19, 2024 16:20
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.

Indexed Color .tga Files Treated as Grayscale Support for Indexed Color images
2 participants