Best resampling method?

carpediem

Regular
Don't know if there's one answer only to this question. But say I have a 32x32x32bit icon. (transparent png) and want to resample it down to 24x24 or whatever size. Is there a method that generally produce better results than others here?

Nearest Neighbour looks horrible of course
Bilinear seem to look ok
Bicubic looks a little better

Are there other, hopefully better, methods?
 
carpediem said:
Don't know if there's one answer only to this question. But say I have a 32x32x32bit icon. (transparent png) and want to resample it down to 24x24 or whatever size. Is there a method that generally produce better results than others here?

Nearest Neighbour looks horrible of course
Bilinear seem to look ok
Bicubic looks a little better

Are there other, hopefully better, methods?

One thing you might want to consider is that you make sure the downscale is gamma correct, i.e. your source data (and destination) are probably in sRGB rather than linear and you really need to do the filtering in linear space.
 
Simon F said:
One thing you might want to consider is that you make sure the downscale is gamma correct, i.e. your source data (and destination) are probably in sRGB rather than linear and you really need to do the filtering in linear space.
This is so true … the image tool I use (mostly PSP9) always calculates RGB as if it linear RGB, while normal onscreen-content is sRGB. 50% black 000 and 50% white 255 result in 128 then (22% gray) instead of 186 (50% gray.)


carpediem said:
Don't know if there's one answer only to this question. But say I have a 32x32x32bit icon. (transparent png) and want to resample it down to 24x24 or whatever size. Is there a method that generally produce better results than others here?

Nearest Neighbour looks horrible of course
Bilinear seem to look ok
Bicubic looks a little better

Are there other, hopefully better, methods?
There is not "the" bicubic filter, bicubic resampling can be done with different coefficient values. For upscaling, I saw once a bspline-based filter which delivered very good results, it was part of a free matlab image libary.

You always lose information with downsampling, so deciding what the "best" filter is, often depends on personal taste. Simon F is right stating one alsways should do any filter math in linear space, so sRGB content has to be converted. (This is also the secret of "gamma-adjusted" AA-downfiltering.)
 
Last edited by a moderator:
The best re-sampling I've seen is that done using fractal algorithms - this works amazingly well for up-sampling (though not as sure for down-sampling). You can get plugins for photoshop that do this, such as Genuine Fractals 4.1. It's pretty astonishing how well it works.
 
Would you mind posting the image in question, if possible? Then we could have a whack at it.


I think that in this case, photoshop's standard bicubic, and then a *touch* of unsharp mask will be the best looking result.


Also, considering your start and end points for this image, I think you'll be splitting hairs to find anything that _much_ better... IMHO.
 
First, thanks to everyone for their opinions.

It's not a specific image, it's more of finding the method that works best for transparent png's that are quite small to begin with.

With the upcoming Maxthon 2.0 browser release, there has been talk (internally) about having dynamic scaling of the icons, so the skinners can tweak the user interface easier than having to go into photoshop and change every icon if they want to resize icons. I just wanted to do some research myself to see if there is a method that is considered better than others for this. And since there are so many skilled gfx and coders here, I thought I'd throw out the question :)

Here's an example from the Maxthon 2.0 UI though... Scaling this between 32pixels and 16pixels with as good results as possible using method X is the goal.

32refresh3ri.png
 
carpediem said:
With the upcoming Maxthon 2.0 browser release, there has been talk (internally) about having dynamic scaling of the icons

Of course, an alternative approach is to describe the icon with SVG(/OpenVG) and then render it to any required resolution.:D
 
Simon F said:
Of course, an alternative approach is to describe the icon with SVG(/OpenVG) and then render it to any required resolution.:D

Yeah, there has been discussions about SVG's too, but it will definately not make it into the release. Future versions might implement SVG support though.
 
If you've seen what VS2005 does to toolbar icons when you use non-standard dpi settings, you will pray for vector icons. Oh, well...
But at least you're downsampling, not upsampling. I think for icons it is a bit more important to preserve sharpness than to have very smooth results.
 
i'd also strongly advise toward SVG in your next version : )
in the meantime, check the AGG library - it has a handful of nice re-sampling algorighms, and a visual comparison test. and it's a cool library to start with.
 
darkblu said:
i'd also strongly advise toward SVG in your next version : )
in the meantime, check the AGG library - it has a handful of nice re-sampling algorighms, and a visual comparison test. and it's a cool library to start with.

Very interesting library! I've forwarded the link to the coders to have a look at :)

Thanks!
 
Xmas said:
If you've seen what VS2005 does to toolbar icons when you use non-standard dpi settings, you will pray for vector icons. Oh, well...
But at least you're downsampling, not upsampling. I think for icons it is a bit more important to preserve sharpness than to have very smooth results.

Yeah, sharpness is definately much more important than smoothing too much when it comes to icons of the size I'm thinking of. Is really VS2005 using SVG's in the interface? Have to take a look then I guess :)
 
carpediem said:
Is really VS2005 using SVG's in the interface? Have to take a look then I guess :)
No, it's not. It's doing horrible upscaling that you can't disable (well, you can set dpi to default, but that's no solution).
 
Back
Top