[cairo] Blurriness when drawing from a temporary surface as the source

Hakki Dogusan dogusanh at tr.net
Mon Jun 29 05:59:34 PDT 2009


Hi,

Adam Richard wrote:
> Hi,
> 
> When I draw a shape normally, it works fine.  However, when I create a 
> temporary surface, draw that same shape on it, then draw using the 
> temporary surface with cairo_set_source, the image is sometimes more 
> blurry (of lower quality) than the one drawn directly.  It is especially 
> noticeable when drawing small shapes; not as much when drawing larger 
> shapes.
> 
> I've only noticed this blurriness in a png file resulting from 
> write_to_png; when I write to a postscript instead it is not 
> noticeable.  I also only notice it when I have matrix transformations 
> set up so that the units of the shape I'm drawing are much different 
> than device units.
> 

I may be wrong but, it may be related to:
FAQ: How do I draw a sharp, single-pixel-wide line?

(I ended up adjusting all coordinates for zooming, instead of using 
cairo_scale.)


> I've tried disabling antialiasing with cairo_set_antialias, and it does 
> get disabled, but the 2 images are still different.
> 
> Does anyone have any ideas as to what could cause an effect like this?  
> I'm new to Cairo so I'm not sure whether it's using some approximation 
> algorithm that could result in unavoidable blurriness in some cases, or 
> whether perhaps I'm doing something suboptimal in setting up my 
> temporary surface to pass to cairo_set_source.
> 
> 

--
Regards,
Hakki Dogusan


More information about the cairo mailing list