This repository contains an image scaling implementation using the bicubic convolution interpolation algorithm written in Python for learning purposes. As the Python version is unusably slow, there is also a Rust implementation included that is quite fast and which might be useful for quickly scaling a large amount of images. Using RUSTFLAGS='-C target-cpu=native
might be useful as there is no manual SIMD usage, but the Rust code works well with auto vectorization, resulting in doubled performance in my tests.
The method was originally introduced in Cubic convolution interpolation for digital image processing by R. Keys in 1981. The method works using the function
Some other kernels like the Mitchell-Netravali filter are also implemented. Generally different kernels affect the sharpness of the produced image. For more information on reconstruction filters / kernels see ImageMagick's documentation.