How can I convert PIL Image in pixbuf?. I tried to change many examples but no solution
import array
from gi.repository import GdkPixbuf
def image2pixbuf(self,im):
arr = array.array('B', im.tostring())
height, width = im.size
return GdkPixbuf.Pixbuf.new_from_data(arr, GdkPixbuf.Colorspace.RGB,
True, 8, width, height, width * 4)
Error
TypeError: new_from_data () takes Exactly 9 arguments (7 given)
I use Pygobject https://live.gnome.org/PyGObject
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…