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

Enable plotting of PNG images with alpha channel #1150

Merged
merged 4 commits into from
Feb 19, 2024

Conversation

ChristianHinge
Copy link
Contributor

Fixes #724

Description

ImagePIL.fromarray accepts and correctly interprets the fourth channel of a png-derived tensor as an alpha channel. I believe that simply allowing for four channels should do the trick. I have tested on a single image with alpha channel.

Checklist

  • I have read the CONTRIBUTING docs and have a developer setup (especially important are pre-commitand pytest)
  • Non-breaking change (would not break existing functionality)
  • Breaking change (would cause existing functionality to change)
  • Tests added or modified to cover the changes
  • Integration tests passed locally by running pytest
  • In-line docstrings updated
  • Documentation updated, tested running make html inside the docs/ folder
  • This pull request is ready to be reviewed

Copy link
Owner

@fepegar fepegar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @ChristianHinge! I've pushed a minor readability edit, hope that's ok.

@fepegar fepegar merged commit e16607c into fepegar:main Feb 19, 2024
14 of 15 checks passed
@fepegar
Copy link
Owner

fepegar commented Feb 19, 2024

@all-contributors please add @ChristianHinge for bug

Copy link
Contributor

@fepegar

I've put up a pull request to add @ChristianHinge! 🎉

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.

RuntimeError: The image must have 1 or 3 channels using tiohd --plot
2 participants