Why is VIPS downsampling so good?

CAcreeks

Forum Pro
Messages
20,530
Solutions
22
Reaction score
3,691
Location
US
Lately I have been viewing images from cameras with too many megapixels, mostly at monitor size (UXGA and FHD).

I am amazed how much better vipsthumbnail resizes images compared to alternatives such as Irfanview (Lanczos), GIMP (Lanczos3 Sinc), and Photoshop (bicubic).

Anybody know why? If you want to try it, the command is available in Linux repositories. I believe you have to compile it for Windows and Mac. The vipsthumbnail command is based on the VIPS library - Resample page is cited below.

 
I am amazed how much better vipsthumbnail resizes images compared to alternatives such as Irfanview (Lanczos), GIMP (Lanczos3 Sinc), and Photoshop (bicubic).
Can you post a few before-and-afters that show the differences you are seeing?
 
Can you post a few before-and-afters that show the differences you are seeing?
Certainly. Here is one from iPhone 4S at FHD monitor height (but not width). I made JPEG parameters the same (vipsthumbnail as downloaded does only 2x2 chroma subsampling). The GIMP one is smaller due to lower sharpness. Click Original to compare.

GIMP Lanczos 3 (Sinc)
GIMP Lanczos 3 (Sinc)

vipsthumbnail -s 1440 (otherwise defaults)
vipsthumbnail -s 1440 (otherwise defaults)
 
Last edited:
I installed Debian package gimp-gluas, but cannot find a menu item for it, although the plug-in browser shows it is available in GIMP. Do I need to write a script that calls it? Thanks.

(Tried the ImageMagick command I used to create thumbnails, including adaptive sharpen, and while better than GIMP, it still wasn't as good as VIPS.)
....gluas (also available as a GIMP plugin) called Decimation. Had a discusson at G'MIC's Flickr but so far nobody's come up with a solution like gluas decimation since some how gluas is doing something more then what is defined in decimation algorithm itself. :)

http://codecave.org/image-processing/chap_resampling.html#id2531205
 
Last edited:
In the second one, the background looks oversharpened to me, but I like the foreground sharpening.
 
This page has a GIMP plug-in ( in Python ) that lets you use various ImageMagick resizing algorithms.

http://www.mm-log.com/blog/2010-01-21/use-imagemagick-within-gimp

Note the download link for the plug-in is http://www.mm-log.com/system/files/mm extern webresize.py_.txt

You need to save that as a Python file ( with just the ".py" extension ) into the "plug-ins" folder of your gimp folder.

On Linux you also need to set the file as executable (!) uisng either your file manager GUI or the usual chmod +x command line stuff.

I tested this on my GIMP 2.8.8 install on Linux Mint and it seems to work fine.

Might also be a useful basis plug-in for adapting to use other ImageMagick commands.
 
In the second one, the background looks oversharpened to me, but I like the foreground sharpening.
I see what you mean, especially in the area of branches against blue sky, above the snow patch.

However I see very few halos, or none. It's more a matter of blockiness in the branches, which could be the result of JPEG 2x2 chroma subsampling as much as the sharpening algorithm.

Also if you display the two images in Firefox and hit Ctrl + until they reach maximum size, this area in the sharper image looks better from normal viewing distance. You can also see horrendous blockiness in the faces due to chroma subsampling.

(I'm waiting for 1x1 and 2x1 before using VIPS on my website.)

P.S. Sorry I forgot to try Photoshop Bicubic with Smart Sharpen last night at home, using our only remaining CS2 license.
 
Last edited:
Current vips has a no-subsample option. There's a blog post about it (see the stuff at the end) but try something like:

vipsthumbnail something.jpg -o thumb.jpg[no_subsample]
Thanks! This option has not yet reached my Debian archive but I will look for a software source to add.

Here is the image with Photoshop bicubic downsampling then Smart Sharpen (radius 1 amount 125). I must give the nod to Photoshop here because image quality seems comparable to vipsthumbnail, but file size is smaller.



Smart Sharpen as recommend by Patrick Lavoie
Smart Sharpen as recommend by Patrick Lavoie
 
Can you post a few before-and-afters that show the differences you are seeing?
Certainly. Here is one from iPhone 4S at FHD monitor height (but not width). I made JPEG parameters the same (vipsthumbnail as downloaded does only 2x2 chroma subsampling). The GIMP one is smaller due to lower sharpness. Click Original to compare.

GIMP Lanczos 3 (Sinc)
GIMP Lanczos 3 (Sinc)

vipsthumbnail -s 1440 (otherwise defaults)
vipsthumbnail -s 1440 (otherwise defaults)
I've never seen such a horrible example of image reduction. Are you trying to sell something?

Post the original for people to resize themselves.
 
Here is the image with Photoshop bicubic downsampling then Smart Sharpen (radius 1 amount 125). I must give the nod to Photoshop here because image quality seems comparable to vipsthumbnail, but file size is smaller.
Wrong!

Don't know what happened on my XP machine, but now that I download these comparisons on Linux and W7, the Photoshop is 748KB and the VIPS is 676KB. I still say downsampling quality is comparable.

Both are JPEG quality factor 90 and 2x2 chroma subsampling, so the size should not be so different. I believe IJG encoding is just better. If I use GIMP to resave the Photoshop image with the same JPEG settings, it is only 632KB.

As the updated Tips and Tricks says, there will be a new version of vipsthumbnail next month.

 

Keyboard shortcuts

Back
Top