Image resampling methods

Preamble This is a companion thread to

(and inspired by the recent activity in my other thread concerning summed-area tables). I am fascinated by the low level stuff that goes on in image processing such as demosaicing that makes our favourite apps work so well.


One notable person in the resampling world is Robidoux (et al.). If you have heard of or are using LoHalo and NoHalo, which have been implemented in GIMP and other places, then you have had a taste of quality pixel wine. You can read an old article of his on the ImageMagick site: https://legacy.imagemagick.org/Usage/filter/nicolas/. It is old, so he doesn’t talk about LoHalo or NoHalo.

Some of you may have worked with him in the past or with LoHalo or NoHalo or other resampling filters. Would be nice to see a discussion here and perhaps have such filters be a part of G’MIC (or even have him join the conversation). If they are too complex or time consuming, perhaps we should start with finding parity with IM as I think we could benefit from these (and if not implementation, at least glean lessons from them):

For certain types of images and operations, tensor Lanczos is the default -resize filter and you can omit “-filter Lanczos”.

Robidoux is the default-distort Resize” filter. This is why the above command does not contain “-filter Robidoux”.

Mitchell is the default -resize filter for some types of images and operations. For this reason, “-filter Mitchell” can often be omitted.

Not sure if G’MIC already has them. I don’t think so. All the filters mentioned in this post may have different, old and new versions depending on the library or source code. The disclaimer would be that I have no idea if anything requires permission to use. They certainly have licences attached to them. It is important to give credit where it is due.

I actually would like to see more sampling approach built-in in g’mic if it were possible.

This paper is why - https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2858241/

I want to see if I can use Hermite sampling in my new version of rep_recpoltrans, and see if it solves issues even better than the current implementation in user.gmic.

G’MIC already uses Hermite sampling. Quoting from CImg.h.

The cubic interpolation uses Hermite splines.

@David_Tschumperle If you have time, give us a bare bones snippet of how we could approach sampling in G’MIC. At least for me, an example is worth a thousand words.