Handle 32bit SVGs with pygoocanvas



I'm using a python script to open SVG images and use them with
pygoocanvas. However the ouput colours are different from the original
colours of the SVG.

My code uses rsvg to handle the SVG image and get a pixbuf from it:

image = rsvg.Handle(imgfile)
pixbuf = image.get_pixbuf()

Then creates a goocanvas.Image like so:

goocanvas.Image(parent=this_section, pixbuf=pixbuf, x=x_pos, y=y_pos)


But when I create a goocanvas.Image with the pixbuf, the colours are
altered. Since the goocanvas pixbuf is 24bit, I expected only the
alpha channel to be ignored, but it seems the rgb channels are altered
too.

Is there a way to create a goocanvas.Image item from 32-bit SVG image
pixbuf, keeping the rgb values exactly as they were? (and just
dropping/ignoring the alpha channel if necessary)?

Thanks


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]