3 ms·
Bilinear is nice for performance, but if you're concerned about image quality you generally want to use bicubic resampling instead.
by calibas 2y ago
Bilinear is nice for performance, but if you're concerned about image quality you generally want to use bicubic resampling instead.
- jeffreygoesto 2y agoOr Lanczos resampling.
- magicalhippo 2y agoLanczos if you want sharpness above all else. There's also the well-known Mitchell-Netravali filters[1], based on piece-wise cubic splines and with two tunable paramerers. [1]: https://en.wikipedia.org/wiki/Mitchell%E2%80%93Netravali_filters https://en.wikipedia.org/wiki/Mitchell%E2%80%93Netravali_fil...
- Dwedit 2y agoWhenever I want to upscale, I use an Edge-Directed algorithm, such as SuperXBR. Diagonal lines stay diagonal and don't turn into blurry boxes.
- jorvi 2y agoI don't know the fine details of it but afaik FSR <3.0 is Lanczos with a few tricks to both speed it up and make the visuals more stable.
- mark-r 2y agoThere's a pair of parameters that make Mitchell-Netravali nearly identical to Lanczos-3, but my grep-fu is failing me at the moment. I'll try to find it later.
- mark-r 2y agoFound it. The parameters are B=0 C=0.5458 in the Mitchell-Netravali formula to emulate Lanczos-3. It's not a perfect match, but I dare you to see the difference.
- magicalhippo 2y agoCool, will check it out.
- daneel_w 2y agoFor upscaling, sure. For downscaling it has a tendency to both amplify and distort (rather than preserve) detail and sharpness, "imagining" detail that never existed, leaving you with a worse result. Bicubic and sometimes even bilinear does a better job, truer to the original, when you're scaling down.
- mark-r 2y agoI think what you're seeing is aliasing. You need to filter for the Nyquist frequency of whichever is smallest, the input or the output. When upscaling the input is always smallest so it's easy. But when downscaling you need to adjust the width - for a 0.5x scale you need a filter 2x the size. I have my own hand coded Lanczos-5 that I use for all my scaling needs, and it's perfect.