Why my image is in bad quality ?

fsn761304 at gmail.com fsn761304 at gmail.com
Thu Dec 17 06:31:00 EST 2015


On Thursday, December 17, 2015 at 5:27:28 AM UTC+4, Nobody wrote:
> On Wed, 16 Dec 2015 06:04:37 -0800, fsn761304 wrote:
> 
> > pixbufObj = Gdk.pixbuf_get_from_window(window, x, y, width, height) ...
> > image = Image.frombuffer("RGB", (width, height),
> >                                  pixbufObj.get_pixels(), 'raw', 'RGB', 0, 1)
> 
> The second-to-last argument should probably be Gdk.pixbuf_get_rowstride()
> rather than 0.

No, this:
image = Image.frombuffer("RGB", (width, height), 
                                 pixbufObj.get_pixels(), 'raw', 'RGB', Gdk.pixbuf_get_rowstride(), 1)

doesn't work:

AttributeError: 'gi.repository.Gdk' object has no attribute 'pixbuf_get_rowstride'



More information about the Python-list mailing list