Efficient Image Resizing with ImageMagick
smashingmagazine.com
smashingmagazine.com
Just no. Use bilinear only when you need very fast resizing and don't care about quality much. Lanczos and sinc [1] filters are considered "best" for wide range of images (no visible blurring or sharpening, almost no moire effects), but they are also among slower ones. Use Catmull-Rom when images need to be sharpened a bit. (See [2] for comparison and scripts) There's also faster and less buggy fork named GraphicsMagick [3]
[1] https://en.wikipedia.org/wiki/Sinc_filter
See Gifsicle [1] for easy animated GIF resizing, which I found buggy in both IM and GM.
Resizing in a sigmoidized colorspace has impressive results with many images. I find it works particularly well with images that should have been saved as vectors, especially when used with eliptical weighted average filters (-distort Resize). It significantly increases sharpness while causing artifacts that are difficult to notice because they don't look like any traditional image processing artifacts.
The same technique is also available in MPV for scaling video.
That way if you want to change your image dimension later you don't have to go back and resize the images.
If you need to do any appreciable amount of work, don't waste your time with any of these libraries. Except for a few, they provide nothing over what running from the shell would give you (i.e. non-native). Just generate a list of commands, newline terminate them, add a chmod +x to the file and run it and be done with it. Or spawn a process and run it. It's much more reliable and will save you a lot of headaches and frustration.