-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
What did you do?
I tried to use the following code to chop the image edges, but the getbbox() keeps returning None.
What did you expect to happen?
I tried 9.5.0 and 8.4.0, it all returns None, but it worked and returned a tuple in older version which I can't tell.
What are your OS, Python and Pillow versions?
- OS: Windows 10
- Python: 3.10.11
- Pillow: 9.5.0
from PIL import Image, ImageChops
im1 = Image.open("001-0.png")
im = im1.convert(mode="RGBA")
im1.close()
bg = Image.new(im.mode, im.size, im.getpixel((0, 0)))
diff = ImageChops.difference(im, bg)
diff = ImageChops.add(diff, diff, 2.0, -100)
bbox = diff.getbbox()
assert bbox is not NoneMetadata
Metadata
Assignees
Labels
No labels
