Skip to main content

Posts

Showing posts with the label filedialog.asksaveasfile()

Image Editing Software | Importing And Saving Images

 Hello friends! Welcome back. This is going to be a single post where you will be learning about importing images, displaying images, and saving the images on the image editing GUI window. So let's get started. We will continue to build our previous code. First, we will add the required library packages to our code.  from PIL import Image from PIL import ImageTk from tkinter import filedialog The Image and ImageTk library packages will be used for opening and displaying the image on the window. The filedialog library will be used for browsing the images from the computer directory that you want to import. Let us now jump to writing the code. For importing a new image you will have to add the following code to the import button callback method . def importButton_callback(): global originalImage filename = filedialog.askopenfilename() originalImage = Image.open(filename) dispayImage(originalImage) We have defined originalImage as a global variable. This is becaus...