[Image-SIG] Moving from Image to Tkinter.PhotoImage

Douglas S. Blank dblank at brynmawr.edu
Sat Aug 18 05:56:54 CEST 2007


I have an image that I have constructed from an array, and need to end up
as a Tkinter.PhotoImage and I am a little confused as to how I get there.

I have this working:

self.array = array([0] * (height * width * 3), 'B')
image = Image.frombuffer("RGB", (self.width, self.height), self.array,
                         "raw", "RGB", 0, 1)

but I need to end up with something equivalent to this kind of object:

pim = Tkinter.PhotoImage(file=filename)

I've tried ImageTk.PhotoImage(image) and other conversions, but I don't
get an object with fields and methods like 'blank', 'cget', 'config',
'configure', 'copy', 'get', 'height', 'name', 'put', 'subsample', 'tk',
'type', 'width', 'write', and 'zoom'.

What will turn image into a pim?

Any hints appreciated,


Douglas S. Blank
Associate Professor, Bryn Mawr College
Office: 610 526 6501

More information about the Image-SIG mailing list