[cairo] pixman box filtering code prototype

Frédéric Plourde frederic.plourde at polymtl.ca
Wed Oct 15 06:35:34 PDT 2008

> No. The upscaing quality is worse than bilinear. It is closer too
> nearest neighbour. An algorithm like this is closer to what you'd want
> for Postscript or PDF rendering though.
Am I wrong or the current upscaling quality with bilinear isn't that bad 
?  It was really the downscaling case that was hurting bad so far... and 
one approach could be to use Jeff's box filtering for dowscaling cases 
(I mean as soon as scaleX OR scaleY is below 1.0) and, SWITCH to former 
bilinear algorithm for upscaling cases... It's seems acceptable in my 
mind, but maybe it's not in phase with cairo's philosophy ?

So briefly, our GOOD scenario would be :

   box filtering for downscaling
   bilinear for pure upscaling (both dimensions)

what do you think ?

> For the default case, I think a better approach is to do a rectangular
> box filter down to the scaled size and then do bilinear sampling from
> this downscaled version as necessary. I think this should be more
> performant than my box filtering code and should give the desired
> quality for any affine matrix...
> -Jeff
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo

More information about the cairo mailing list