While scaling images in GIMP in the Quality section I was prompted to choose one of the following interpolations:
- None
- Linear
- Cubic
- Sinc(Lanczos3)
What is the difference between these and which one is the best in terms of quality/loselessness?
While scaling images in GIMP in the Quality section I was prompted to choose one of the following interpolations:
What is the difference between these and which one is the best in terms of quality/loselessness?
These four options define how to scale the image. Each option describes an algorithm used to do this. See image sampling.
None: The nearest-neighbor algorithm is used. There is no smoothing after scaling.
Linear: Touching pixels average their values.
Cubic: Touching pixels average their values so central pixels maintain the most value.
Lanczos: Pixels are passed into an algorithm that averages their color/alpha using sinc functions (similar to sine interpolation, somewhat like cubic).
None of these algorithms are directly superior, as the links describe. Instead, it would be better to list the situations in which you'd most like to use one over the other:
None (nearest-neighbor): Use when you want absolutely no sampling (blurring) of the image.
Linear: Use when you have very small text; cubic interpolation is usually better otherwise. This produces blurred, but jagged, edges.
Cubic: Use for most images. Unless the image is very small or incredibly detailed, cubic and bicubic interpolation helps keep edges smooth. According to Wikipedia, it can sometimes increase perceived contrast or cause artifacts.
Lanczos: This interpolation method is much like cubic except that instead of blurring, it creates a "ringing" pattern. The benefit is that it can handle detailed graphics without blurring like the cubic filters.
I prefer nearest-neighbor for pixel art, linear or lanczos for small text, and cubic for everything else. These choices are subjective and by no means the 'proper' usages for the algorithms.
Sinc/Lanczos is theoretically optimal for downsampling (shrinking) images. Provides anti-aliasing with minimal blur. Very important for scientific work. Unfortunately, it has been removed in 2.10, and replaced with some other methods which yield blurrier results, at least for significant downsampling. I am usually downsampling high-resolution scientific data for browsing/preview.
Unfortunately, closest I can figure out with Gimp 2.10 is to apply a gaussian blur, followed by nearest neighbor (none) scaling down. This is a little blurrier than sinc at best. At least you can trade blur for aliasing distortion, whichever is more acceptable for your application. It is a real bummer, since it adds a lot of clicks to get an inferior job done.
For some reason, ImageMagick takes forever to do this. Might see if there is a command line inkscape to speed this process up