-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Resizing produces different results for Pillow 6.2.2 and Pillow 8.0.1 #5039
Comments
I'm not actually able to replicate this on my macOS 10.15 machine. How did you install both versions of Pillow? |
Steps to install:
|
JPEG is a lossy format, and different versions of libjpeg will interpret it differently. If you're worried about bit-for-bit differences, you need to use a lossless format like PNG. |
I wonder if this is the same as #5069 - if you run from PIL import Image
print(Image.core.jpeglib_version) in both situations, what do you get? |
I get 9.0 in both cases. |
Could you attach the images output by each version of Pillow? |
Now that #5367 is merged, Pillow 8.3.0 should have different resizing results again to Pillow 8.2.0 |
If I try and run the following code on our macOS 10.15 CI
I find that the output matches - https://github.com/radarhere/pillow-wheels/runs/2904979445?check_suite_focus=true#step:4:346 |
From what I can see, Anaconda doesn't install Python 3.6 to start with anymore. You're on macOS 10.14 though so it seems conceivable that you just installed it a while ago. Closing, as I'm not able to replicate. This can be re-opened if a way to replicate can be found. |
What did you do?
Resized an RGB image (from (640, 480) to (8, 8)), with resample parameter set to
Image.ANTIALIAS
usingPillow 6.2.2
and saved the resized image. Then I upgraded the Pillow version to the latest(8.0.1)
and repeated the above steps with the same image and same parameters. Then, reloaded both the resized images withImage.open
and compared the resized images using==
operator (of pillow images). To check equality, I then typecasted the resized images to numpy array and compared element by element.What did you expect to happen?
I expected the resized images to be same for the same images across the mentioned Pillow versions. I see that the default value for parameter
resample
has changed across these versions, but since I fixed the resample parameter to the same value (Image.ANTIALIAS
), I expect the resized images to be same. I see that another parameterreducing_gap
has also been added after Pillow 6.2.2, but going through the source code, I don't really see how it should lead to a different behaviour if the default valueNone
is used.What actually happened?
The resized images compared to False when compared with == operator. When the resized images were typecasted to numpy array, most elements were different.
What are your OS, Python and Pillow versions?
Ran the below code once for Pillow 6.2.2 and then for Pillow 8.0.1:
Then loaded the resized images:
Source image is attached.
The text was updated successfully, but these errors were encountered: