CONV

Resize, stretch, rotate, skew and correct the perspective of an image from one continuous picture rebuilt between its pixels.

Preparing source0%

Every source pixel is used.

Output size

Height follows width. Use Stretch to set them apart.

The output grows to contain the whole plane at this pixel scale.

CONVPreparing
100%

Fit keeps small images at their original size. Drag the picture to pan.

0%

EWA · windowed Jinc

Elliptical weighted averaging with a three-lobe Jinc-windowed Jinc filter.

CONV range
—
Comparison range
—

Ranges are measured before display clipping, in premultiplied RGB units from 0 to 1.

Preparing the source…

What CONV is

CONV is a new way to rebuild an image between its pixels: the first genuinely new interpolator of its class since Lanczos’s windowed sinc and its extension to arbitrary transforms, the elliptical Jinc-windowed filter that this tool compares it against. Those kernels are linear, applying the same weights whatever the picture holds, and that is why sharp ones ring.

CONV is nonlinear: it reads which rises and falls the pixels actually contain and lets the curve make only those turns, while keeping every original value and every cell’s total. The result is one continuous picture of the image. Resizing to any size, rotating, skewing and correcting perspective are all readings of it, and its multiresolution form returns the original exactly. It still compiles into ordinary convolution banks, and it already does the transforms in Plan Paint.

Four dark samples followed by four light samples define one step.
The pixels: one clean step from dark to light.
The curve dips below the dark samples, overshoots the light ones and settles, adding two turns beside the step.
A sharp linear kernel adds two turns the pixels never made, seen as a dark rim and a bright halo.
The curve rises once between the dark and light samples.
CONV makes the one rise the pixels contain, as sharp as the step allows.

How it reads the pixels

Take one row. Between each pair of neighbouring pixels the value rises, falls or stays level, and the order of those rises and falls is the shape the row actually has. CONV first proposes a sharp curve across each gap: a fifth-degree polynomial whose slope and curvature at each pixel are estimated from the five nearest pixels. Wherever the row is smooth, that proposal stands. Where it would bend the wrong way, as a ringing kernel does beside an edge, CONV moves the curve by the least amount that removes the extra turn, keeping both end values.

Columns follow the same rule. For resizing, CONV treats the rows and then the columns. For rotation and perspective it reads rows and columns in both orders, joins the results into one surface of matching polynomial patches, and checks every patch against the directions in which its own pixels rise and fall. The paper gives the definitions, the proofs and the measurements.

Resizing and stretching

Enlarging reads the continuous picture at the new pixel positions. Those positions are aligned at the image’s first and last pixels, so at 2× and 4× every original pixel reappears unchanged, with new ones between. Shrinking averages the picture over the area of each larger pixel, so fine stripes settle toward their mean instead of folding into false patterns. Width and height are handled separately, which is all a stretch is: one axis may grow while the other shrinks.

The same averaging gives CONV its multiresolution form. Halve an image, keep the small corrections that CONV’s own curve fails to predict, and the original returns exactly, value for value. The tool runs the plain resize; the paper sets out the exact return.

Rotation, skew and perspective

A perspective change alters both the direction and the spacing of the samples. Doing it as a chain of resizes and shears would rebuild the picture at every step. Here the source is analysed once into its continuous surface, and moving a corner changes only the map used to read it, which is why dragging stays live.

Point synthesis reads the surface at each output pixel. Where perspective crowds many source pixels into one output pixel, pixel-area integration averages the surface over that pixel’s whole footprint instead, with exact formulas for flat maps and, for perspective, a fixed quadrature rule chosen from the geometry alone. Pixels along the edge of the plane keep their partial coverage as transparency.

The default comparison is elliptical weighted averaging with a three-lobe Jinc-windowed Jinc filter, built as in ImageMagick’s area resampling: an ellipse taken from the inverse map at every output pixel, every source pixel inside it, no mipmaps and no cap on stretching. Its negative lobes can carry values outside the source range, so the tool reports both ranges before clipping. Lanczos-3 and bilinear are available as point-sampled comparisons. The warp addendum derives the patch construction, the exact pixel integrals and the quadrature with its accuracy proofs, and the source receipt records the reference files and the checks on this browser port.

Measured against Lanczos

In 160 hard-edge tests, steps and boxes at 32 sub-pixel positions on each of five grid sizes, CONV never added a turn; Lanczos-3 added turns in all 160. CONV with only its correction removed adds them in all 160 as well, so the correction is what does the work. On well-sampled rows of 129 pixels, CONV also had lower error than Lanczos-3 for all 56 test signals.

A grid of analytic test images, an edge, a carrier wave, a dark disc and a crossing pattern, each rebuilt by CONV, Lanczos-3, bilinear and EASU beside the true image. Lanczos-3 leaves a pale ring around the disc; CONV does not.
Analytic test images rebuilt on a dense grid. Lanczos-3 leaves a pale halo around the dark disc; CONV, shown here in its compiled form, does not.

The compiled form

For a fixed scale, CONV compiles into a short chain of ordinary operations: fixed filter banks that estimate slopes, a single pass that records the order of rises and falls, a one-number correction for each gap, and fixed polyphase banks that produce the new pixels. The paper and its figures call this compiled form CONV*. This tool uses it to shrink the view when Fit is on, and Plan Paint uses it for its transforms.

Limits

Everything runs in your browser and images stay on your device. Resize and Stretch accept up to 5 million source pixels and produce up to 5 million; Skew & perspective accepts up to 16,777,216 source pixels and 8192 pixels on either output side. Pixels are handled as premultiplied 8-bit sRGB, not linear light. CONV keeps edges from ringing; it does not recover detail that was never sampled. On very coarse smooth patterns, around nine samples across, and on the warp study’s smooth frequency field, Lanczos can have the lower average error. Where several edge directions meet inside one patch, the directional check relaxes and constrains less.