-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
What did you do?
In version 7.1.0, after converting the file to RGBA the getbbox will return None instead of the bounding box of the difference of the two images. This has happened on every file I have tried it on so far. This was working on and below 7.0.0.
What did you expect to happen?
It should return the same result as if it wasn't converted.
What actually happened?
It returned None
What are your OS, Python and Pillow versions?
- OS: Mac 10.14.6 and ubuntu:18.04
- Python: 3.6.5
- Pillow: 7.1.0 though 7.2.0
This a small reproducible test case though the python shell.
Version 7.0.0 (working)
>>> from PIL import Image, ImageChops
>>> img = Image.open('some_file.jpg')
>>> bg = Image.new(img.mode, img.size, img.getpixel((0, 0)))
>>> diff = ImageChops.difference(img, bg)
>>> diff.getbbox()
(328, 328, 3880, 3885)
>>>
>>> img = Image.open('some_file.jpg')
>>> img = img.convert('RGBA')
>>> bg = Image.new(img.mode, img.size, img.getpixel((0, 0)))
>>> diff = ImageChops.difference(img, bg)
>>> diff.getbbox()
(328, 328, 3880, 3885)Version 7.1.0 (broken)
>>> from PIL import Image, ImageChops
>>> img = Image.open('some_file.jpg')
>>> bg = Image.new(img.mode, img.size, img.getpixel((0, 0)))
>>> diff = ImageChops.difference(img, bg)
>>> diff.getbbox()
(328, 328, 3880, 3885)
>>>
>>> img = Image.open('some_file.jpg')
>>> img = img.convert('RGBA')
>>> bg = Image.new(img.mode, img.size, img.getpixel((0, 0)))
>>> diff = ImageChops.difference(img, bg)
>>> diff.getbbox()
>>> Let me know if you need any other information.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels