-
-
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
Pillow's JPEG decode result different from OpenCV #6047
Comments
Using one of our test images, import numpy as np
from PIL import Image
print("Pillow", np.asarray(Image.open("hopper.jpg")).sum())
import cv2
print("OpenCV", cv2.imread("hopper.jpg").sum()) I actually get the same result for them, 4345064. If you run my code over our test image, do the results match for you on your machine as well? Perhaps you do need to upload your image? |
@radarhere eh, I upgrade my pillow version from 9.0.0.a to 9.0.1, and then this error has been fixed. maybe I have installed an alpha version of Pillow ...
And I reproduce the problem on version 8.0. On Pillow 8.0.0, one version
I get
|
Pillow 9.0.0 changed to compiling with libjpegturbo instead of libjpeg on all platforms (not just Windows): python-pillow/pillow-wheels#237 It has been previously reported that results with libjpeg are different, but this is to be expected: #3833 (comment) |
Thanks all. |
What did you do?
hey, for some reason, I have to do something about Image decoding. And the conclusion is, Pillow's JPEG decode result different from OpenCV in some cases.
Code:
I find a blog talking about this, but it seems nothing changed after half a year.
link
What did you expect to happen?
I think the output of the two functions is the same, but I got different.
What actually happened?
What are your OS, Python and Pillow versions?
I think this can be reproduced in any jpeg image. I will upload the test image, if necessary.
The text was updated successfully, but these errors were encountered: