67

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?

1
  • 1
    I prefer for downscaling Lanczos - superb sharpness in photo.
    – Kyle
    Jun 23, 2018 at 9:57

2 Answers 2

53

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.

5
  • 1
    lanczos windowed sinc is clearly superior in most cases. But it may not be optimal to have a 3pixel wide lanczos filter. It may cause a bit of ringing tough.
    – joojaa
    Dec 24, 2014 at 15:36
  • I think the nearest-neighbor is actually objectively the proper one (or at least significantly objectively better than Linear, Cubic, and Lanczos) for pixel art. Jan 3, 2016 at 20:07
  • Good answer. Could we get an updated answer that includes NoHalo and LoHalo? Even better would be a description of (or proper name for) those new algorithms.
    – Matt
    Jun 11, 2020 at 16:14
  • @Matt I haven't heard of those algorithms yet; if you know more, you should share in a comment here if it's quick or maybe as a new answer. I'm keeping this answer as-is because it addresses the OP's questions asked, but an "in addition to so-and-so, some time has passed and these new techniques/topics should be considered" post is a frequent phenomenon across subsites of Stack Exchange, so I'd encourage you to post about it.
    – kettlecrab
    Jun 13, 2020 at 0:58
  • Descriptions of the Halo siblings are on this site at graphicdesign.stackexchange.com/questions/138059/…. There's a comparison vs Lanczos3 using objective metrics. And why did they remove it? well, gegl 0.2.0 says the lanczos was broken and removed, and gimp 2.10 was all about moving to gegl. Aug 1, 2023 at 14:23
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.