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
How to improve imresize
for downsizing
#28
Comments
This page points out that one can effectively use the same splines that we use for interpolation, but stretch them to cover the "grid" of the reduced-size image. Not entirely trivial to implement, but not insanely difficult either. I suspect the main question is whether we want to support multiple splines or just pick one. I suspect if we started with linear (triangular splines) we'd be pretty happy. Interestingly, that page suggests handling one dimension at a time, rather than computing the result directly. It's the same strategy that |
Thanks for the pointers. I think this is currently a little beyond me in terms of skill and time, but a good thing to keep in mind. |
I am also curious about interpolations for upsampling/downsampling of images, the MATLAB and Pillow both support several methods, and some of them, for example , the Lanczos kernel seems easy to implement in the image filtering framework, is it possible to just add the kernel, and then, we can use filtering and imresize to achieve anti-aliasing resizing? |
This is now available (provided by #115) since v0.8.11: using Interpolations
imresize(img, sz; method=Lanczos(2))
imresize(img, sz; method=Lanczos4OpenCV()) |
I'm closing this in favor of #120 as I didn't observe any particular bad alias result. But feel free to reopen it if this is still an issue. |
Right now
imresize
performs something that is pretty similar to simple pixel sub-sampling. Naturally the quality of the result isn't particularly breathtaking.I open this issue to brainstorm on what would be a good way to improve the quality for downsizing and image to an arbitrary specified size.
The straight forward way of doing it would be in two steps: 1.) Filter image, 2.) sub-sample. However, this would add an additional temporary array that I suspect could probably be avoided.
The text was updated successfully, but these errors were encountered: