Is there a way of rotating ImageTk after it has been defined?

Viewed 66

rather than writing something along the lines of:

tkimage = ImageTk.PhotoImage(image.rotate(angle))

it would be far more effective in my code to use something like:

tkimage = ImageTk.PhotoImage(image).rotate(angle)

as all of the images are set up before hand and would be near impossible to change later. Is there anyway of doing this? Or even some kind of way to get the file name from a PhotoImage() such as retrieving 'name.png' from

tkimage = ImageTk.PhotoImage(file='name.png')

Even that would be much simpler than recreating every single imported PhotoImage() whenever I want to rotate them.

0 Answers
Related