[cairo] High Quality ImagePattern Scaling
andrew.ingram at titanemail.com
Wed Aug 27 04:28:34 PDT 2008
Sorry to pester about this, I don't mind if what I want can't be done
with Cairo, I'd just prefer to know one way or the other so I can try
something else if I need to.
Andrew Ingram wrote:
> Hi all,
> Having explored other options i've come to try using pycairo to resize
> and rotate some png images. The problem i'm having is that no matter
> what options I specify, I can't seem to get the resized images to be of
> a high quality, the output is very pixelated even without rotating.
> This is my algorithm:
> image = cairo.ImageSurface.create_from_png(path)
> # some mathsy calculations
> pattern = cairo.SurfacePattern(image)
> surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT)
> context = cairo.Context(surface)
> context.rectangle (0,0,WIDTH,HEIGHT)
> output = cStringIO.StringIO()
> I've tried using PIL to achieve this but the quality for rotations was
> very poor, cairo seems to do rotations to a reasonable quality but
> resizing is a different matter.
> Andrew Ingram
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
More information about the cairo