[cairo] Downsampling bitmaps from RSVG quality

Emmanuel Pacaud emmanuel.pacaud at lapp.in2p3.fr
Wed Jul 22 23:10:00 PDT 2015


Hi,

Le jeu. 23 juil. 2015 à 6:43, Samuel Williams 
<space.ship.traveller at gmail.com> a écrit :
> I'm resizing and generating PNGs from SVG inputs.
> 
> I want the best possible quality but the downsampling of large input 
> images to small output images seems to be quite crude.
> 
> I've tried looking at how to use set_filter but it's not obvious how 
> to use this in conjunction with RSVG's render_rsvg_handle. I tried 
> rendering to a recording surface and then using a surface pattern 
> with a filter set but that didn't help. Here is an example of the 
> Ruby code:

In your code, you are not doing subsampling, you just render a SVG file 
to a bitmap surface with a given size, which mean set_filter will 
almost do nothing (except for the possible bitmap subsurfaces rsvg is 
creating while rendering, in the case of blur filter for example).

So what you get currently is the best possible cairo rendering of an 
SVG file. Without givin any specific example of what you find crude in 
the PNG output, it will be difficult to understand what goes wrong.

	Cheers,

		Emmanuel.






More information about the cairo mailing list