You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently had to re-run a benchmark which I originally did in late 2018 and found a significant performance regression. The code below compresses a set of 10,000 1-bit (mode 1) 28x28 images using PNG and WebP and reports the average compression ratio in bits per pixel. Anything less than 1 means the images have been compressed, anything larger than 1 means the compression has failed for some reason, and resulted in a longer byte string than the raw images.
Please let me know if there's any more information that I can provide.
To run the code below you will need NumPy and also torchvision (part of PyTorch). Torchvision is used to obtain the benchmark image dataset and can be installed with pip install torchvision.
So this was a bug fix. You're checking these images for size, not correctness. I think if you were to eyeball the output with 5.4.1, you would find that it is incorrect.
I don't think there's any reason why the fixed version should be larger than the 5.4.1 version, apart from the fact that the image content becomes different - making it unfair to compare their resulting sizes.
If you have any additional thoughts this can be re-opened.
I recently had to re-run a benchmark which I originally did in late 2018 and found a significant performance regression. The code below compresses a set of 10,000 1-bit (mode 1) 28x28 images using PNG and WebP and reports the average compression ratio in bits per pixel. Anything less than 1 means the images have been compressed, anything larger than 1 means the compression has failed for some reason, and resulted in a longer byte string than the raw images.
When running this with Pillow 8.1.0 I get
In Pillow 5.4.1 (the version I used back in 2018) I get
Please let me know if there's any more information that I can provide.
To run the code below you will need NumPy and also torchvision (part of PyTorch). Torchvision is used to obtain the benchmark image dataset and can be installed with
pip install torchvision
.The text was updated successfully, but these errors were encountered: