We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Following the docs to apply point transforms: https://pillow.readthedocs.io/en/stable/handbook/tutorial.html?highlight=.point(#applying-point-transforms
The following exception was raised: 'float' object cannot be interpreted as an integer.
'float' object cannot be interpreted as an integer
Code to reproduce
from PIL import Image image = Image.open(image_path).convert('RGBA') alpha_channel = image.getchannel('A') image.putalpha(alpha_channel.point(lambda x: x * 0.5))
With Pillow 8.3.2 and Python 3.8, the above code worked well.
Edit: I've tested Pillow 9.1.0 with Python 3.9.12 and it works fine, so it seems to be an issue related to Python 3.10.x
The text was updated successfully, but these errors were encountered:
Thanks. This would be because of https://docs.python.org/3/c-api/long.html#c.PyLong_AsLong
Changed in version 3.10: This function will no longer use __int__().
__int__()
I've created PR #6188 to resolve this.
Sorry, something went wrong.
Great, it should do the trick. Thanks!
Successfully merging a pull request may close this issue.
What did you do?
Following the docs to apply point transforms:
https://pillow.readthedocs.io/en/stable/handbook/tutorial.html?highlight=.point(#applying-point-transforms
What actually happened?
The following exception was raised:
'float' object cannot be interpreted as an integer
.What are your OS, Python and Pillow versions?
Code to reproduce
With Pillow 8.3.2 and Python 3.8, the above code worked well.
Edit: I've tested Pillow 9.1.0 with Python 3.9.12 and it works fine, so it seems to be an issue related to Python 3.10.x
The text was updated successfully, but these errors were encountered: