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
[x] I have read the CONTRIBUTING docs and have a developer setup (especially important are pre-commitand pytest)
[x] Non-breaking change (would not break existing functionality)
[ ] Breaking change (would cause existing functionality to change)
[ ] Tests added or modified to cover the changes
[x] Integration tests passed locally by running pytest
[ ] In-line docstrings updated
[ ] Documentation updated, tested running make html inside the docs/ folder
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
CONTRIBUTING
docs and have a developer setup (especially important arepre-commit
andpytest
)pytest
make html
inside thedocs/
folder