[cairo] Concerns about using filters for downscaling

Owen Taylor otaylor at redhat.com
Tue Mar 25 19:40:41 PDT 2014

On Tue, 2014-03-25 at 16:57 -0700, Bill Spitzak wrote:
> I'm also still mystified by the "two filters" approach. I have no idea 
> what you mean by the sampling and reconstruction filter. I have done a 
> lot of image processing, and transformations only use *one* filter, 
> called the "sampling filter". This filter changes depending on the scale 
> and on the fractional portion of the sample point.

It's pretty standard as a formalism to consider a resampling operation
as reconstructing the image with one filter, and then sampling it with
another filter. The convolution of the two filters gives you the single
resampling filter.

See e.g., George Wolberg's Digital Image Warping, chapter 5. (He talks
about prefiltering, not a sampling filter... same thing.)

Now, when upscaling, the choice of sampling filter doesn't matter much,
and when downscaling the choice of reconstruction filter doesn't matter
much - which is why it's normal to just talk about the resampling
filter. (Wolberg, p. 122)

- Owen

[ Also demystified by the code in cairo/src/cairo-image-source.c and
  pixman/pixman/pixman-filter.c ]

More information about the cairo mailing list