Page 1 of 2

Info about Resampling algorithms

Posted: Fri Sep 16, 2005 7:21 am
by thire
When I change the size of an image, in XnView there are serveral possibilities (algorithms) to do that:
*next neigbour
*bilinear
*gauss
*hermite
*bell
*bspline
*michell
*lanczos
I wonder when to use which and how they act!
There is a discussion in the german wikipedia goning on at http://de.wikipedia.org/wiki/Wikipedia_ ... ochrechnen about this. Can anybody help?
Thomas

Re: info about algorithms

Posted: Fri Sep 16, 2005 10:23 am
by xnview
thire wrote:When I change the size of an image, in XnView there are serveral possibilities (algorithms) to do that:
*next neigbour
*bilinear
*gauss
*hermite
*bell
*bspline
*michell
*lanczos
I wonder when to use which and how they act!
There is a discussion in the german wikipedia goning on at http://de.wikipedia.org/wiki/Wikipedia_ ... ochrechnen about this. Can anybody help?
It's only different interpolation method between 2 pixels.

Posted: Fri Sep 16, 2005 10:33 am
by thire
Yes, I imagine, but where can I get closer info.
a) about the algorithms themselfs
b) about when to use which method? (speed, quality, special situation)

Posted: Fri Sep 16, 2005 11:14 am
by Olivier_G
Have a look at this PDF file, with explanations and illustrations for some of them.
Some more advanced techniques are compared here: http://www.americaswonderlands.com/digi ... lation.htm

Usually:
- when speed is an issue, bilinear gives good results (nearest neighbour is the fastest, but really ugly for most uses)
- for quality work, lanczos and bicubic are often recommended

Olivier

Posted: Fri Sep 16, 2005 11:21 am
by thire
ool. thanks.
I will have a loser look at the pdf. :)

Posted: Fri Sep 16, 2005 1:08 pm
by Drahken
Take a fairly small image and increase it's size by 300% using each of the different methods, compare the results. That is the only real way to get an understanding of the differences between the algorithms. You will find 3 main differences between the results: speed, detail, blurriness. In general, the closer they are to the top of the list, the faster and uglier they will be. The closer they are to the bottom of the list, the slower, better, but blurrier they will be. (Note that blurry isn't always bad. You will often find that if you use a blurrier algorithm and then sharpen the result, you will have a better image than if you used a less blurry algorithm.)

Some rules of thumb:
Mitchell is generally the best one to use, I find that it gives the best results in most cases, and rarely needs sharpening afterward.
Lanzcos will usually result in slightly better quality than mitchell, but will be quite blurry and will look bad unless you sharpen it quite a bit.
If you have a slow computer, bilinear is probably your best choice.
If you're resizing a GIF file, use next neighbor. Any other filter will change it to a 24bit image, and will wreck any transparency.

While we're on the subject, is there any chance of getting the Wiener filter added to xnview? It's a slow algorithm, but it gets great results on most images.

Posted: Fri Sep 16, 2005 1:11 pm
by thire
cool, thank you. I will try something out as well! :)
And I just use it for resizing (or resampling?!) jepg-images.
Thomas

Posted: Sat Sep 17, 2005 7:36 am
by helmut
Perhaps worth while writing an FAQ. Forum member "Lasse" has tested the resizing of screenshots using various resampling algorithms of XnView. He provides the results on his webpage.

See also topic FAQ "How to resize images with text (screenshots)".

Image for impress

Posted: Mon Nov 06, 2006 10:51 am
by rjbgbo
For quality impression which is the indication.

*next neigbour
*bilinear
*gauss
*hermite
*bell
*bspline
*michell
*lanczos

Thank for the attention.

Posted: Wed Mar 21, 2007 9:51 pm
by jokoon
Sorry for unearthing the topic, just a fast question ...
Is Bspline the bicubic algorithm ?

Posted: Thu Mar 22, 2007 8:19 am
by Troken
I wonder if they are all needed? Seriously, how many are using most of the methods? Imo its more confusing than contributing, wouldn't it be a good idea to take some of them away?

For me these would be more than enough (and still more that photoshops three):
- next neighbour
- bilinear
- bspline (or bicubic?)
- mitchell
- lanchos

Posted: Thu Mar 22, 2007 1:13 pm
by foxyshadis
Mitchell is bicubic.

Agreed that some of the resizers aren't very useful. Could be worse, could be the full list of imagemagick resizers. :p Gauss, bell, and bspline are almost indistiguishable, and often only useful as specialized effects, not generic outputs; in general they're too close to bilinear to even matter. There are a wide range of bsplines but this one doesn't retain much sharpness. Hermite is practically indistiguishable from Mitchell - in fact it's one of the degenerate cases of the Mitchell/Netravali filter, iirc. Those who actually care about these others would probably also care enough to want their tunable parameters as well, or more advanced non-separable resize kernels.

So point, bilinear, bicubic, and lanczos would seem to be enough for anyone using batch resize. If you wanted to emulate photoshop, you could have a bicubic smoother (lower "c") like photoshop, to fill that halfway point in.

Posted: Fri Mar 23, 2007 12:48 pm
by Troken
Nearest neighbour is very important too, for ie enlarging gifs or screen dumps.

Posted: Fri Mar 23, 2007 3:18 pm
by foxyshadis
Oh, sorry. Point, box, and nearest neighbor are (usually) synonyms for the same thing, so I have a bad habit of mixing names up. :p

Posted: Fri Mar 23, 2007 7:11 pm
by jokoon
Thanks :)
It was just to be sure paint.net has not anything special about resizing algorithms.