Re: Handle 32bit SVGs with pygoocanvas



On Thu, 2011-12-15 at 10:43 +1300, Benjamin Warren wrote:
> 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)?

How are the colours altered? Are they completely wrong, or just slightly
too bright/dark? (Try changing the canvas background colour to see if
that affects it.)

If it looks like a bug, you should probably contact the rsvg people.

Damon




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