[Tkinter-discuss] tkinter.PhotoImage to PIL.Image
Vasilis Vlachoudis
Vasilis.Vlachoudis at cern.ch
Fri Dec 6 03:36:18 EST 2019
Thanks Michael,
at present my program is based that all the images are loaded as tkinter.PhotoImage.
I am trying always to keep the python dependencies as low as possible.
PIL is not required apart when the user wants some specific functionality (add-ons)
So for the case that someone wanted to resize them (PIL would be required)
and I was thinking to resize them by temporarily converting them to PIL.Image
and then back to tkinter.PhotoImage.
Maybe my way is not the cleanest, but rather to do as you propose, load them as PIL.Images
process and convert them to tkinter.PhotoImage.
Vasilis
________________________________________
From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=cern.ch at python.org] on behalf of Michael Lange [klappnase at web.de]
Sent: Wednesday, December 04, 2019 19:28
To: tkinter-discuss at python.org
Subject: Re: [Tkinter-discuss] tkinter.PhotoImage to PIL.Image
On Wed, 4 Dec 2019 19:25:45 +0100
Michael Lange <klappnase at web.de> wrote:
> resized = im.resize((height, width), IMAGE.ANTIALIAS)
^^^^^^^^^^^^^
oops, should be
resized = im.resize((width, height), IMAGE.ANTIALIAS)
.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.
The sight of death frightens them [Earthers].
-- Kras the Klingon, "Friday's Child", stardate 3497.2
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss at python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss
More information about the Tkinter-discuss
mailing list