[cairo] Downsampling bitmaps from RSVG quality

Emmanuel Pacaud emmanuel.pacaud at lapp.in2p3.fr
Fri Jul 24 00:34:26 PDT 2015


Hi,

Le ven. 24 juil. 2015 à 5:38, Samuel Williams 
<space.ship.traveller at gmail.com> a écrit :
> Yes, it has an embedded PNG file. IT's stupidly high resolution, but 
> the reality is it isn't downsampling it well for some reason with 
> Cairo/RSVG and it isn't obvious how to fix this.
> 
> https://drive.google.com/file/d/0B4svTYmRKR87eVR5LWoxQV9QQlU/view?usp=sharing

It looks like it is a limitation in both cairo and librsvg. In cairo, 
to my knowledge, the default filter is NEAREST, and it is not possible 
to define a different default.

In librsvg, filter can not be changed.

A possible workaround for you would be to use an intermediate bitmap 
surface bigger than the final one, render the SVG on it, then use it as 
a pattern with filter set to BEST on the small final surface.

	Cheers,

		Emmanuel.



More information about the cairo mailing list