-
Notifications
You must be signed in to change notification settings - Fork 3
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
Convolution resampling and other libraries #8
Comments
libvips also has adaptive convolution resample as well as fixed window interpolators -- it has two completely different paths for the two systems. I think that comment went in in 2015 after we swapped some mails. You said that pillow-simd always used adaptive convolution, so I wanted to avoid penalising pillow-simd, and picked nearest. Do you think |
Could you disclose why they are separated? If you have both, the good solution is to choose one of them internally based on scale factor, but do not let a user spoil the data. In my opinion, fixed window interpolation shouldn't be used for the shrinking at all, because even with scale factor from 0.5 to 1 the window width will be > 2.
Yes. To be honest, I also think that VIPS's method should be changed to adaptive convolution and OpenCV's method to INTER_AREA. |
It's just historical: vips used to just have fixed-window interpolators, and the adaptive kernel stuff was added in 8.3 (I think). I've swapped everything to adaptive, I think. |
There is a comment in
pillow.py
:I'm pretty sure that there are other libraries which do convolution resize. For example, ImageMagick and its successor GraphicsMagick. Maybe others.
Also, sips and libgd do supersampling resampling which quality is much closer to Bicubic convolution and complexity close to Bilinear convolution.
Using nearest neighbor only in Pillow unfair to other libraries. While resizing with 4-point bilinear interpolation (like in VIPS) is not suitable for scale factors < 0.5, for 0.9 (used in the test), it much closer (both quality and complexity) to Bilinear convolution rather than to nearest neighbor.
Rather than using nearest neighbor for all of this libraries, I believe it's better to use Bilinear for Pillow and add some note for VIPS, OpenCV and possibly others.
How to check
It's simple. Try to resize with scale factor 0.1. If a zoomed result will look like this, it's convolution or supersampling.
If it looks like this, it's 4-point bilinear.
The text was updated successfully, but these errors were encountered: