Upsize

UPSIZE: An image upsizing plugin featuring two modes.
1. Smooth (IBFNBQH): Image upsizing with Interpolatory Box Filtered Natural BiQuadratic Histosplines. [This is the default option.]
2. Sharp (EANBQH): Exact Area image upsizing with Natural BiQuadratic Histosplines.

This plugin was written by Nicolas Robidoux and Adam Turcotte at Laurentian University in Sudbury, Ontario, Canada.

LAST UPDATED: October 20, 2009

Note: This is a refined version of the code that was used to create the HQ_Rescale plugin for Windows (http://registry.gimp.org/node/13187).

For more details regarding these methods, see Fast Exact Area Image Upsampling with Natural Biquadratic Histosplines by Nicolas Robidoux, Adam Turcotte, Minglun Gong and Annie Tousignant, pp.85-96 of Image Analysis and Recognition, 5th International Conference, ICIAR 2008, Póvoa de Varzim, Portugal, June 25-27, 2008. Proceedings, Aurelio C. Campilho, Mohamed S. Kamel (Eds.). Lecture Notes in Computer Science 5112, Springer 2008, ISBN 978-3-540-69811-1. Only the "Sharp" version is explicitly discussed; "Smooth" differs in that it is box filtered (and in that this implementation uses a different image size convention than the "Sharp" resampler).

Average: 5 (2 votes)
AttachmentSize
upsize.c171.61 KB
upsize_win.zip46.62 KB

Comments

Upsize smooth and sharp

More or less, Upsize smooth (IBFNBQH) gives results which one would expect from a smoother (but not blurrier) Catmull-Rom (the smoothest interpolatory bicubic), and Upsize sharp (EANBQH) gives results which one would expect from Catmull-Rom unsharp-masked with a tight radius and then blurred with an even smaller radius.

On the technical ("math") side, the code for this plugin contains a tridiagonal solver which uses less than 2 multiplications and 2 subtractions per row (less than a typical tridiagonal matrix-vector multiply), relying on the rapid convergence of a continued fraction to pack the lower and upper factors of the coefficient matrix in seven single precision constants. This code also stores intermediate results in 16 bit integers with no significant truncation error. See the article cited above by Adam for details.

The code contains a fairly fast, non-bit twiddling (plain C), rounding and clamping macro (F_ROUND_AND_CLAMP_0255).

Although the theoretical derivation is different, Upsize smooth (IBFNBQH) gives results which could also be obtained with (global interpolatory) natural cubic splines.

Windows binaries

Thank you for providing the Windows binaries. It has been added to the attachment list.

Thank you Sylvie

Merci Sylvie pour les binaires Windows.

nicolas