Redimensionarea imaginii sub PhotoImage

Am nevoie să redimensionez o imagine, dar vreau să evit PIL,deoarece nu pot face să funcționeze sub OS X - nu mă întrebați de ce ...

Oricum, deoarece sunt mulțumit de gif / pgm / ppm, clasa PhotoImage este ok pentru mine:

photoImg = PhotoImage(file=imgfn)
images.append(photoImg)
text.image_create(INSERT, image=photoImg)

Problema este - cum redimensionez imaginea? Următoarele funcționează numai cu PIL, care nu este echivalentul PIL?

img = Image.open(imgfn)
img = img.resize((w,h), Image.ANTIALIAS)
photoImg = ImageTk.PhotoImage(img)
images.append(photoImg)
text.image_create(INSERT, image=photoImg) 

Vă mulțumim!

17
задан Abhipso Ghosh 4 December 2016 в 21:24
поделиться