8000 Interpolation_samples · libvips/libvips Wiki · GitHub
[go: up one dir, main page]

Skip to content

Interpolation_samples

John Cupitt edited this page Mar 29, 2017 · 1 revision

title: Interpolation samples permalink: /Interpolation_samples/

Previously, vips only really had nearest-neighbour and bilinear interpolation. Each operator implemented it's own resamplers and it was hard to add new ones.

We now have a general type for interpolators, it's easy to add more interpolators, and they can be used by any operation that needs to resample images. As well as the nearest-neighbour and bilinear we had before, we've added bicubic, and one called YAFR-smooth, which is bicubic plus an extra non-linear filter to enhance diagonal edges.

Here's an example of sizing up an image 250% and examining a detail, pixel by pixel. The differences between bicubic and YAFR-smooth are subtle. Drag the samples to separate tabs and try flipping between them. vips also includes an enlarge operation based on GREYCstoration, I've included this at the end. It does the equivalent (roughly) of turning an image to a vector, upsizing, then going back to pixels again. It is extremely slow.

The sample image is from http://www.cambridgeincolour.com.

| | | |-------------------|--------------------------------------------------------------------------------------| | Sample image | [Image:Tut enlarge cat1.jpg](/Image:Tut_enlarge_cat1.jpg "wikilink") | | Nearest-neighbour | [Image:Tut enlarge cat1 nn.jpg](/Image:Tut_enlarge_cat1_nn.jpg "wikilink") | | Bilinear | [Image:Tut enlarge cat1 bl.jpg](/Image:Tut_enlarge_cat1_bl.jpg "wikilink") | | Bicubic | [Image:Tut enlarge cat1 bc.jpg](/Image:Tut_enlarge_cat1_bc.jpg "wikilink") | | Nohalo1 | [Image:Tut enlarge cat1 nohalo1.jpg](/Image:Tut_enlarge_cat1_nohalo1.jpg "wikilink") | | YAFR-smooth | [Image:Tut enlarge cat1 yafr.jpg](/Image:Tut_enlarge_cat1_yafr.jpg "wikilink") | | GREYCstoration | [Image:Tut enlarge cat1 greyc.jpg](/Image:Tut_enlarge_cat1_greyc.jpg "wikilink") |
Clone this wiki locally
0