3 ms·
Bilinear uses the triangular kernel over the source image (with size corresponding to the input pixel size). Area interp works very well in practice, it's more
by bonoboTP 6y ago
Bilinear uses the triangular kernel over the source image (with size corresponding to the input pixel size).
Area interp works very well in practice, it's more sophisticated than just a box filter on the input and sampling. It calculates the exact intersecting footprint sizes and computes a weighted average. Do you have examples where this causes aliasing and can show a better alternative?
- contravariant 6y agoYou can use any image with a high frequency regular pattern. Wikipedia has the following example: https://en.wikipedia.org/wiki/File:Moire_pattern_of_bricks_small.jpg https://en.wikipedia.org/wiki/File:Moire_pattern_of_bricks_s.... Anything softer than area will help with those kind of issues (which is why the original https://en.wikipedia.org/wiki/Aliasing#/media/File:Moire_pattern_of_bricks.jpg https://en.wikipedia.org/wiki/Aliasing#/media/File:Moire_pat..., looks fine in most browsers even if your resize it). Bicubic tends to do better in this respect. It's a trade off though.
- bonoboTP 6y agoSorry, but this is wrong. Area has no aliasing, all others introduce aliasing artifacts when DOWNscaling. https://imgur.com/a/C6utkwr https://imgur.com/a/C6utkwr Now you could use pre-smoothing with a kernel and then resampling, but then we are talking about something else. It's important to understand that interpolation happens in the source pixels, so it does not help when downscaling. Cubic tends to look nice, yes, but only when UPscaling.
- contravariant 6y agoYeah if you're going to be using interpolation to downscale it's obviously going to look worse than even the most basic version of downscaling. That's why downscaling uses the transpose of the the interpolation kernel, not doing that and being surprised the result doesn't look good is just silly.
- bonoboTP 6y agoDo you know of any image processing library that has an implementation for that?
- contravariant 6y agoImagemagick should work. It also has quite an extensive documentation: https://legacy.imagemagick.org/Usage/resize/ https://legacy.imagemagick.org/Usage/resize/. Though it's a bit hard to know where to start. I'm fairly certain it'll tell you somewhere that interpolation and downscaling use their kernels differently, but I couldn't tell you where.