Python Forum
[Tkinter] Saving images
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Saving images
#3
I imported PIL at the begining of my code: from PIL import Image, ImageTk .
I have longer code (it is only part which I use to save photo) unfortunately I wrote it in different language so I must rewrite it to english before I sent it here.
image = Image.open(filename)
photo = ImageTk.PhotoImage(image)
a = image.filename = asksaveasfilename(initialdir = "/",title = "Select file",filetypes = (('JPEG', ('*.jpg','*.jpeg','*.jpe','*.jfif')),('PNG', '*.png'),('BMP', ('*.bmp','*.jdib')),('GIF', '*.gif')))
image.save(a)
I save image (class Image not PhotoImage). Should I use PhotoImage for save? Like:
 a = photo.filename..., photo.save(a)
? But I think PhotoImage has no module to save it. Where else could there be the problem?
Reply


Messages In This Thread
Saving images - by Christina - Sep-13-2019, 12:55 PM
RE: Saving images - by Larz60+ - Sep-13-2019, 01:10 PM
RE: Saving images - by Christina - Sep-13-2019, 01:38 PM
RE: Saving images - by Larz60+ - Sep-14-2019, 03:16 AM
RE: Saving images - by Christina - Sep-14-2019, 09:40 PM
RE: Saving images - by Larz60+ - Sep-14-2019, 10:00 PM
RE: Saving images - by Larz60+ - Sep-14-2019, 10:06 PM
RE: Saving images - by Christina - Sep-15-2019, 06:26 PM
RE: Saving images - by Larz60+ - Sep-16-2019, 12:37 AM
RE: Saving images - by buran - Sep-16-2019, 07:02 AM
RE: Saving images - by Christina - Sep-16-2019, 05:59 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020