The Image Resampler algorithm is used to rescale the input image by means of resampling its content to make it conform to the output image dimensions.
No pre-filtering is applied, it's expected that the input content doesn't have frequencies higher than the Nyquist limit to avoid aliasing artifacts when downsampling.
Several interpolation methods are available, allowing trade-offs between quality and performance.
Input | Factor | Output |
---|---|---|
![]() | \begin{align*} f_x &= 2/3 \\[5pt] f_y &= 3/2 \end{align*} | ![]() |
For every output pixel, calculate the corresponding input pixel using the formula:
\[ \mathit{out}[x,y] = P(f_x x, f_y y) \]
where P depends on the interpolation method used.
Sampling operation considers that whole coordinates fall on pixel center.
Consult the Image Resample for a complete example.
Constraints for specific backends supersede the ones specified for all backends.