Build a desktop application that convert pictures from PNG to JPG using Python and Tkinter | Amine Mokhtari | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Build a desktop application that convert pictures from PNG to JPG using Python and Tkinter

teacher avatar Amine Mokhtari, Developer & video editor

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

6 Lessons (52m)
    • 1. Final new

      0:46
    • 2. Explaining the idea of our application

      4:10
    • 3. Creating the skeleton of our application

      16:07
    • 4. Opening the picture and puting it in the app

      10:16
    • 5. Create the function that converts from the png to jpg images

      14:32
    • 6. Create the function that converts form the jpg to png

      6:09
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

52

Students

1

Project

About This Class

Hello everyone,

In this course, I will be your guide step by step to build your first application.

I will show you how you can write a program that converts pictures from PNG to JPG and from JPG to PNG using just simple functions in Python.

Then we will put this program in an application that will be created using Tkinter so that it will be a good project to help you in your daily life and even if you want to share the project's idea you won't share just a program because not anyone can read and understand a program for that you will share the final application so that anyone can use it. 

Meet Your Teacher

Teacher Profile Image

Amine Mokhtari

Developer & video editor

Teacher

Hello, my name is Amine I'm a computer vision student I love everything about electronics, coding, and video editing so I created a YouTube channel to share my knowledge then I wanted something big so I started doing courses on Skillshare.

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Final new: Hello everyone. My name is Marcel remembers. I mean, I am a computer vision students and online content creation. I have used Python for several tasks, including building desktop applications. In this course, I will show you how you can win skeleton and how you can add buttons, labeled images, and trees on this application. This course is for anyone interested of how to read the servo applications using Python. Therefore, you need to have a basic level in Python. Although I will be explaining everything in this course, we will the desktop application that's converts pictures probably and gt, GBG and vice versa. So let's get started. 2. Explaining the idea of our application: Hello everyone. At the end of this course, I want to read an application with you. So we will put all what we learned in our course and we will build an application together. So I will show you how it will look this application, it will look something like this. So when an application, first thing we will do is to explain to you what kind of obligation and we will breed. So as you can see here in the title, we have image conversion. So we will, with an application that will convert pictures. So if we have a picture in PNG type and we want to convert it to JPEG, or we have a picture, we GPG type and we want to convert it to BAG type. This obligation will help us to do this. So I will explain to you how it works. So for example, we have here, this is framed as an empty frame. Then we have these three buttons. The first button will converse the picture from the PNG to the GPD. And this button will convert picture from the GPG to the PNG. And this button will clear. What if we have a picture here, it's clear it and here, if we have something like this, this Watson, we'll create it. So here we have, we have to enter the name of the file that we want to save it. So if we don't, if we forget, for example, to tape them, to type the name of our file, of our new picture or our converted picture. Once we, we do, for example, if I click here, we see this window which will ask which pixel, which picture I want to convert. So if you can, if you see I have selected just the PNG pictures because if we want to converge around the PNG to GPD, we have to select just the PNG pictures. And the same thing here. If we want to convert from the GPJ to the PNG, we have to select just the GPG pictures. So if I will start, I will, I won't write the name of the file that we want, that we want to be saved. I will just click here. I will select this picture as, as you can see. Here. We, there is no picture. The first thing that is now picture we couldn't uploaded. And the second thing, we couldn't convert it or save it because we didn't enter the name. As you can see, he entered the name of your file, please. So if we will type the name, for example, I will give it name, name, just name. I would give you just the name of James, named PNG, for example. If we want to take a picture from the GPG and converts it to a PNG, we will give it the name for the name B and G. Now we will upload the picture. As you can see, these pictures are all PNG types. We can't take the DBN G2 to convert it to GBG. So we will take GPG and convert it to the PNG. So I will take this one, for example. As you can see it upload the picture here and it is converted and saved it as you can see your picture as is. So save it successfully. Now if we go to our, to our directly on our projects folder, we will find the new picture. The same thing if I will clear it, for example here, the same thing if I go to, if I want to convert the PNG picture. So I will write here, for example, name. So GPG, because it will be a PNG and we will convert it to the GPG. So here we have the GPG. So I will take here, that is, all these pictures are in the PNG pictures. So I would take, for example, this one. Now, as you can see, this is the picture that this picture is that PNG and it will be saved as this name, name GPG and with the type D BG. And it will right here, your picture is saved successfully. So we will work on this project together and will, will this application step-by-step? And that was for the explanation. In the next video, we'll start boiling it. So C, u, the y. 3. Creating the skeleton of our application: Hello everyone. Now it will start building our app. So in this video, I will show you how we can create the skeleton of the app, which means that we will create the buttons, labels, and the frame. So as you can see, this is a picture of our app. So we create these buttons, the entry, this label, and this frame. So the first thing that we have to do is to create the window. So we will import the tick interlibrary from Tkinter. Import everything now creates the roots. Root equal d k. Now we put it in the main loop two, don't forget, it may look like this. Now we will do some changes of the app, will change the geometry, the color, the title, etc. So we will start by the tighter. You have this one. As you can see, image conversion like this. Now we will make, the icon, will give the icon here. I can. Now we have Logo dot o. We have done this before, so I am doing this too fast. Now we will make the geometry so rules that geometry. I will put it, say 500 by 650. So we have like this one, like this. We will see it how it looks for the moment. Now this is the window. Now we will change the color circle routes that configure. Here we have BG equals I. Choose the color which one b, one b, 21. I think that this is the color, this one, as you can see, this is the scholar, this background, background color is this one. So this is the app. The app now we will start making stuff on it. So we will create the labor of the frame, which is this one. After that will create all these buttons and angry and this label. So to create frame, I will make a comment here. For example, create a frame like this. Now we will call it frame, frame function. We will put it in the roads like this. Now. We will, we will choose the width and the height of this flame. So for the, for the width, we'll take it just like the width of our app. I will make it a little bit smaller. So we will make it like this with a call. I will make it 450 than the high. I will make it 500. Then we will packets in the, in this, this frame that pack, like this. Not pack, I will make a great cause we need to get all the other stuff. So I will make a grade here. I will put it into row 0. Then the column 0. And I will make a column span for three nodes like this. Column span equals three, I will divide the AP injury site three columns because we need the first column for this button. For example, the second column for this button, and third for this wasnt. Okay, now we will see how it looks. We stop it and here we have our, our frame India cell. We will make some padding on it. The first thing that we have to do is to make padding on x, which is this function here. So we make, but x equal 25. We'll see if it is great. I will add a little bit, make it 27. Like this. It is in the middle. This is great. Now, we will make the I will make some padding on the why. Not yet I will put this after because I don't want it. I will make some padding on the y for the moment. But why? For, for the function of the padding, there is something that I didn't told you about. We can write, for example 20. So if we write 20, we will have 20 padding in the top and 20 in the button. But if you want to make just bottom, sorry. But if we want to make padding just in the top, for example, we can use this function, but we will add this parentheses. So we have here two parameters. The first parameter is how many buddy we want to make in the tab. And here we will have many budding we want to make in the bottom. But sorry. So for this case, I will make, for, I will make two in the top. And here I am exhort 0. After that, I will see if we'll change it or not. Now, here we have two. Great. Now we create the buttons. So we have, as you can see here, we have three buttons. The first button is for the PNG conversion from the PNG to GPG. The second button is to clear and third is from the GBG to the PNG. So we've created here, I will make it like this. Creates the buttons like this. Now, the first button that we have is to convert from the PNG to GPG. So we'll give it the name PNG to GBG. Since the name of our button. No, now here we have button and we'll put this in the roots. Root. Now we give it the text. If we give it the name which is P&G, GPG, like this. Now after that, we will change the, give, change the font and we will make some padding on the X and the Y to, to, to control the size of our button. So here we will make the size of, we make the padding on the eggs equal 20. Now the padding on the y equal, I will put it seven. Now for the, for the color and the font. I will give it here, man. But I will change the, the size of the fossil fuel, put it 20 and bolt. Like this. Now, I will packets before iron part is after data frame as you can see. So here we have PNG to GPG equals F1, sorry, GPG does great. But PNG, JPEG dot it is not working. This S1, sorry, that's great. Like this. Now we will put it in the low one because we have the frame in the low 0 and we want the button will be after the frames that we will put it in the low one. Let me make some space here. So here we have the rho equal one, then we have the column, we put it in the column 0 because it is the first item. So here we have column equal to 0. Then we will do some padding, will do it after photon, which will let it just like this. So we have in-frame in row one and column 0. We'll see how it looks. This is our button. So I will make some padding in the Y for our frame to put this down. So we have, what is it? This one? So we have 0. I will put it, for example, five, and we will see how, how it looks. It is great like this. So now what will we do? We have, we have created this button. Now we will create the second and the third. So second is four to clear. I will put this just like here. Clear, clear, equal, bottom. Now we will put it in the root. Then we have text equals clear. Same thing. Now, I will take just like this one and this one and this one control C, control V. To make it just like the first one, I have to park it two gradients. So we have here clear that great than it is in the same row, but it is the second column. So we have, we have to put it just like this. Rho equal one. Then column equals one is because it is the second button. Now we will see how it looks. So you can see that there is the first button and second button. Don't worry about it because as you can see here, we have this button in the middle, but it will be in the middle when we will create the stirred button, okay. So here we have to create the third button, which is from the GPG, GPG to PNG equal bottom button. No, now we put it in the roots than the text equals. Here we have GPG to PNG to be like this, and we will just copied, we have already copied it, so we'll just use it. I will start this. Now we have two packet, so we have here GPG to PNG dot grade. Then we will just make it in the same row, which is row one, then the column it is in the third column, sum, which is the column two. Like this. Seriously how it looks here, as you can see, it is just like the same. Here. We have this one. This is the first, this is the second, third. Now we have created the buttons. We have just to create this label and this entry. So just too easy for us for the moment. We have the label. So you created here. Make it common. For example, cre, create label for the finding. Like this. Now, i will make space like this. Now. Now we're created. I will give it, for example, the name of file, file name, label. Now we'll create it like this label. We will put it in the rows. Then you have the text. As you can see here, the text is filename. So we will let it just like this. We have here, find name. Now, we will change the font and we will change the size of the text. So we will give the color because if we let it like this, we will have the background of our, our label, Blub white, but we want it is the same thing of this color background. So I will just copy this from here. Control C, control V. Now we'll change the font. The font I will make it equals propaganda. We have used this before. Profile gun, like this, proper, kinda like this then the size 12 and we'll put his wallet. Now, we will package here. We have it in the second, in the third row, which is row two. So we have here a file name that label, that grade. It is in the row equal to than the column. I will put it in the column 0. Now, this is our, this is column 0. We will see how it looks for the moment. This is our label. We will push it down a little bit. So we'll use the padding in the y. Now, we will do some padding just in the tub. We will use this function, this parentheses in the tub will do, for example ten, but in the bottom will make it 0. We will don't want some padding on the bottom like this. Put it more down the 20. And we would see, okay, it is great. Here. It is just like this one. Now we have to create the entry. So here we have make a comment create and 34. The file name like this now were created for example, like this box or I don't know, Polish, just like this filename without label. So here we have an entry and we will put it in the routes like this. And to make the size of this entry as, as much size of our labor. So for this, we have to change the font size of our font size for this one. So we'll just make it like this formed. Which one? I will take just this one or this one. Great Control C. Then what is it? This one, control v. Now we will see, I forget your packets. Bucket just here. We have fine name, not the label that grade, that grade. And he will put it in the same row of labels solo equal to, then the column equal one because he wants to. In the next segment, we'll see how it looks. Here we have this one, we'll put it, put it down. We take this same thing here, but think of Y, and we'll put this here. Now as you can see, this is the, this is what we see here in the picture as you can see here. And this is our app. We have changed the name and I can add, we have created these three buttons and we have this labeled like this one. And we have the entry. Now we will stop here. And in the next video we'll start making the functions for each button of this and we will create and finish our app. So I see you the stay safe by. 4. Opening the picture and puting it in the app: Hi again. Now we start creating the functions for each button we have here. So the first function that we'll create is the function for this button which will convert from the PNG to GBG type. So here we have to defend our program which we, which we, which is this one for the lame for the window. Now it is an empty window, it do nothing for the moment. Now starts creating the functions for forecasting. So here the first thing that we have to do is to import libraries for. So here we have from Tkinter import the File dialog because we have to create the window does we'd ask us what the images for the images we want to create to convert story. Then we have to create two where we will work with datacenter images. So we have to import from import image TK or ticky image TK like this, then the images, image like this as imagery. Now, after we have imported this functions will start creating. We have created story, we have imported these liabilities, start creating the function. So the first function, as I told you about this button, which is B and G, two GPG. So we'll put it here as the command. So we have sorry, command. What I am doing, command equal, I will call it, for example, PNG to GY, BG, GPG. Now this is our function. I will put this in uppercase, like this. Copy, contour C. Then we will put it here. We have here create the function that will convert from PNG to GPG like this. So here we have the, this one, the name of the function. Now. Now what we have here, the first thing that you have to is to create a file dialogue that will ask us to choose the, the picture that we want to convert. So as we did before, we write it just like this. Here we have roots and that filename, like this. Phi name equal. Here we have File dialog that ask open. Now here the first, the first thing that we have to do is the title of the window. Title equals i will like this. I will put it choose a picture. You can put it anything you want. Now the second thing is the file type. File types. I forgot file types. Here we have equal. Now we will start. We have. Parentheses here than there is another parentheses to select. We will select the PNGs and the second parameter is we will take the all types if you want to see all your pictures, we will take it here. So the first thing here we have PNG files. Then here. And here we have everything that PNG, because we did this before. This star means everything, which means every name we have dust that P&G. Now this is this was the first the first time than we have here to put the second, which is I would put all types. Then what we will have a comma, then we have everything that, everything that ability. Now we have created this one. We will see if it works. Just like this. Click this button. As you can see, this is our window. Here we have the title, choose a picture, and here we have PNG files, and you have here all types. Ok. Now, after creating this, we have to, if I want that, if I choose a picture, I will put it in this frame, which is this one. I want to pick to put the picture Susan in this frame. So to do this, before that we do this. We have to see if, if the, the path that we have, cuz if the user selects the picture, because if we don't select the picture, we don't have a path of any picture, so we can't use it to open the picture and puts it in the frame. So the first thing that you have to do is to make a condition. So if this part is different to an empty string, so if roots but filename doesn't equal an empty string, in this case, we will put it in the frame as we don't put anything to don't have an errors after. So if it is different to fire an empty string, in this case, the user has chosen a picture. So now we will put it in the, in the frame. So I call it For example, I may make it PNG picture equals. We have here image that open. Now inside this function, open, we have to provide the path of the picture that we want to open. And as you can see, we have here that filename is the part of the fun of the picture that we have chosen after, after creating the window, etc. So we have just to put this one copy, then we will put it here. So if we will put this part here, this function open, which is in the image objects, will open the picture for us. Now, after that, we will open it. The first thing that we have to do is we have to resize it before because if we have ten, hundreds of pictures, we don't we don't know if all the pictures has the same size. So to make it very clear and very clean work, we have to resize it in the same site. Any picture we have chosen, we have to resize it in the same size. So here we will change it as we will use the function resize, which is included in the image object. So we'll make it for example, air are which is resized PNG picture. P&g, picture, dot resize, resize, and he will put the parameters, the first parameters. The first parameter is the width and height, will put it as the same thing of the frame that we have here, that the fame. And here you can see the frame has the width of 450 and height of 500. So we put it in the same thing here we have 450 by 500. And the second parameter that we have is the image that and the audience, as I told you to delete all anions that we have. If you have. Now, after that we have resized it. Now we will use the function which is included in the object image dk. After that, we will put it in the frame. Now. We'll call it, for example, picture equals. Here we have what is it? Tk image. Tk image, this one. But photo image. Now here we will put the picture that we have, resize it. So PNG picture. Now, if you want to put the picture in the frame, we have first to put it in a label. After that, we will put the label in frame. So here we will create a label, which is I will call it labor equal. Here we have the function like this, not lambda label. And here we will put it in the notes in the roots, in the frame, sorry, in the frame because we want that the picture will take the place of the frame. So here we have frame than the, what will I do? I think that this is all we, sorry, we have to make the image. And here we have picture. Okay? Now we have just to park this label, so label that back. As you can see. You will see that we can't see the picture for the moment because we have opened and something. I have this. You got it. You can see that there is no picture here. Why? Because I told you that if we have a picture in the function, but we want to put it in the main route. We have to put this picture as a global variable. So we have here just to write global picture. Now it will work as we did before. We have here to select it. Here we have our picture. So if we if we stop it and run it, you can see that if we press here, it will open this window for us. We have European g. So if I click this one, it will open for us. So here in this video we have done this little line, this sunlight's to open the picture and resize it and convert it to make it ready for the frame. Not suffering for all and for all the tickets are up. So at this line we have created labels and we have noted the image in this label. Then we have labored. In the next video, we'll start converting the picture and save it. 5. Create the function that converts from the png to jpg images: Now we have to start the conversion. But before that you started conversion, I want to give you a remark. So for example, if we have here this, which is this one. If I will press this one, I would choose this function, this picture, sorry, we will have this, but if I would want to choose another picture, if we will click this one and we will choose it, you will see that we have a problem. So to fix this problem, we have to destroy the first picture which was here. After That's reports, that new picture. So to do this, we have to, there is a function for the frames. We will use it here. Like this. The function is, we have, for example, we have items in the frame, so we have to destroy all the items that we have in this project. We have just a picture that will be inflamed, but we have to make a loop that will destroy everything we have. So we have fall. We were actually just like these four items. For example, in in. Then here we will find items in frame, that frame, we have the frame in that info. Info, where is its info? Sorry, windows info. That bush children when in full. But children. So children means that all the items that we have in the flame, so every item we have in the frame, which is every children we have in the frame. We will destroy itself, will make like this. So item, we'll make it just items, items, every item in the frame. So item data destroy Who will destroy it from its cell? When we press the button, it will destroy the picture that we have. If we have in the frame, after that, we'll put the new ones and we will see if we weren't here. If we click it, we will choose this picture. Now if I want to just another one, if I will click, you will see that there is no picture for the moment. Now, if I will click and choose another one, it will be great. There is no problem for this one. Now we will start the conversion to it. To make the conversion idea is, I told you about the conversion from the PNG or JPEG binary. We use this when we want, when we were using the desert basis. So where do we want when we want to put a picture to a database, we have to convert it to the binary. After that, we have to put it in the database. So we use this idea and put it in the UP. So the first thing that we have to do, for example, if we have BIG picture, will convert it to the binary. After that, we will convert this from the binary to JPEG in this case. So to do that, the first thing that we have to do, as I told you, we have here this up. The new the new fired or the new picture will be with the name that we will put here. So in case we don't have, we don't put a name here, we will have an error. So we have to verify this from the beginning. So if this, this entry or the name of the picture doesn't equal an empty string. In this case, we restart the condition. But if there is no, no name here, we won't. Any, any conversion, and it will be right for us to hear a message that say, please enter the name, etc. So to do this, we have just to see if this is, if this file name which is defined a much which is here, not finite, we have here filename. So if we put finite, that gets, we will get the, the, the text that we have in the entry. So if this filename that gets doesn't equal the file, the string, empty string. In this case, we will start the conversion as we will do nothing. So here we have, this is the function. Now we will make this condition. If phi name that get like this doesn't equal the was that if it is equal, we start by doing the air. After that, we will do the else. So if the filename that finite that gets the equal, the empty string, in this case we will make the error message. So we'll put this in was in labor. So we will make it like this error. We will call this error equals label here. We'll put it in the root. Then we will put the message, which is text. Text equal. Here we have enter your file name, please. Okay. Now, if we have the, if we have an objective, if we forget to put the name of our file, in this case, it will ask us to enter the name in uppercase. Then we will pockets that get much, Get Great. And here we have we put in the rotary because we are in the rotary. So we are individually, I will see 012, so low equal three. Then we'll put it into column 0 because the first column, like this, I will make hits just I will make span, for example, column span. I will put it into column two in the 2 first columns. So we will try it here. For example, if I want to write anything, you can see here this is the text. I will change the color, I will make it read as you know, for don't forget it. So here we have bg four for the foreground, I will put it red. And for the background in the same color of the AP, which is this one. Copy. And we have here this collar. So we will see it, how it looks. We have this one. So this is the message until your filename please. So here I will put somebody on X because we will need it after. But X equals 4040. We can't see it for the moment was needed after this, I will tell you where. So here nothing's changed. So here after that we have, we know if this if we forget to type the name of the new file, he will ask, he will ask us, but in this case, we want that He will destroy the label because if I didn't enter the name of the file in this case, I don't want it to open the file and I don't want it to convert it and save it. So here we will label, which is the picture label that destroyed. So we see it here. If I will choose this one, USE that there is no picture because he didn't upload it. We see that it is uploaded, but he is uploaded that he destroys. It destroyed because we didn't make the name here. So we will make, we don't want, we don't have any conversion and we can't save it. So here we have if and we will make the As for the moment. And in this case here we will make our conversion. So as I told you, the first thing that we have to do it is to put it in the binary. After that, we will put it from the binary to the GPG. Now we have the fight is in the, in the, sorry, PNG. So we will make the function open, which is this one open, that not that open here we will make the parallel the parameters that we have here. We have to put the name of the order. You have to put the path of the picture that we want to convert. Here. As we know, we have the name which is root that file. This is the path that we have chosen after, after clicking on the picture of, after choosing the picture that we want. So we'll put this here. As you can see, we have in the first condition that we have here, if this, if, if, if here we have not this one, we want to put all this inside. If we have, if the root dot fie name doesn't equal to the empty. Yes, we have two here. If this if the root, that fie name, which is the path, if it is different to the empty string. In this case, we will do the confession else. We don't have to do the condition because there is no path. So I forgot to push it down. Now, like this, if that frame doesn't equal to the empty string, here we will do the, the conversion. So we have here to open it. Now here the second parameter which is read binary because we have to read, the first thing that we have to do is to read the picture and puts it in the binary. And you make as big, for example, it doesn't matter. So here we have the new picture which is in binary. So when adipic equals to b dot, read this one. Now, this variable which is binary peak, has the value of the picture in the binary type. Now, after this, we have converted into binary dour will really make it in another time in a picture, but with the PMA. So he had the PNG type will make PNGs type, but the name, we choose the name which is written here. So the name that's which is written here is named file data gets. So here we will make with open the same thing that we have to do. Here. We will make the name here, the first thing here like this, which is fine name that gets plus what we have plus the PNG, JPEG, sorry, GPG, because we want the, we want the extension of the picture P&G. So we will, we will have here the name that we have written in this entry, that PNG. So we'll put it all in the string and put it as a parameter as the first parameter of this function. Now here we have the second parameter which is right, binary from the binary writes it and puts it and make it as a picture. Here we have same thing as peak. I will make it just pick. I think that's it doesn't work. I will make it just just a peek. And here we have this one. Here, what we have new, I represent New Pig to doesn't have a problem, to not have a problem with the first one. So we have here the mu pq and here we will make this. You pick which, which will be a GPG picture equals two new pig butt, right? And here we will make the name of the picture that we have in the binary, which is this one outdoorsy and make it like this. So in this case, we will take the picture from the binary type and put it in. We will take the picture from this file and convert it to the binary. After that, we will recall and puts it in the PNG JPEG, sorry. So here it was in the PNG and here in binary, and at the, at the end here in the JPEG. After that, we will make a message. For example, your picture is saved. So we'll make a label called Save. Here we have labeled with impulses in the root. Then we have the same thing here. I will just copy this one. See like this controversy that not look like this one. This one Control C. And we'll delete this, and here we will write a text. For example, your picture is saved. Sixes fully. Now will change the color because we don't want it like this. So I will put it, for example, I don't know why it's like this. And this the background at the Bogata, I will let it just like this. So we see if it work here, we will have, we will make this name, for example, name or new name, not new name. And we will choose the picture. So we have this picture, for example, we have open it here. And there is no message saying because I didn't buckets hurry back into the picture here, we have this one. So save that. Great. I always forget to packet. I don't know why. I will just take it from here. This one, control c and control v. Now, we'll see if it work here. We have to type the name as I told you for tape, it's name, name, big lake, just like this. We'll choose this function, this picture, sorry. So as you can see here, picture is saved successfully. We will see if it works. If we have named picture, we see we have name pig here in GPG. This is the picture that we have converted. As you can see it work for the GPG. Now we will stop here converting the picture from the PNG JPEG. And the next time we will do is from the GPG to the PNG. 6. Create the function that converts form the jpg to png: Hi again. Now what will we do with the function that will convert from the GPG to the PNG. Actually H, Same thing because it will do the same thing. It will convert it to the binary than from the binary, which will convert it to a PNG here. So we'll just copy this function and passed it. After that, you will change just some words to make it unique for GPG. So here we'll make the command here for GPG, here for P&G. Now here we have command equals GPG to make it uppercase to B and G. Now we will define it. Here. We will just copy this one, this function on this taking, take it, take it. Just like this. I will just this one too. I am lazy man, because I like copy-paste. So here we'll make it GBD, Dp g to the PNG, PNG picture. Now here we'll change the name. We have GPG to be mg. Now this is the function that we have written here. It is the same thing. Now we will start changing things. The first thing that we had to change is the name of the picture because we have here global picture, so we have to change it to not have problems with the other function. So we will proceed, for example, picture one. Why not here we have picture wherever is it, where is it refined? Whereas picture here we will be getting one. Then here one. Now we have no problem with the name picture, okay? Since the workforce for the lazy people had just changed this one picture. Picture that is no pictures, no. Okay. Now the second thing that we have to do, this is the same thing we haven't. We don't have to change it. Here. We will make the file chain JPEG files. And here putting dot GPG, This is the first thing that we have to change. Now, here we have GPG picture. So I will put it like this, GBG. Now, the same thing here, GPG, and here I represent DPH GBG two. Now here we have resizing GPG picture. Now, which is great here. Now what we see in this part, knots, this one, and this one is, it's sitting here. We have to change the picture. We just change the name. Here we have that P&G because we will converge from the GPG to the PNG picture. Here I will make it David, the name P&G. Now, where is it? Png picture. Okay. Png picture. Equal this one. Now, what will we do? We have just to change it. Here. We have created the picture, but we didn't say this one. Ok. Now we have changed, we have converted and saved it as we did before. Now we see if it work. Here we have the GPG button. If we click a button without giving a name, we will see here enter the filename. Then if we give it a name, for example, Gee, I don't know. Green eyed flowers is named this area parties green. Here we have, as you can see, JPEG files, as you can see GPG. Now, all the picture here, JPEGs or if I will take this, this one, it will be converted. Your picture is saved successfully. So it was this for the PNG or JPEG. Now we will make just this easy to make this one. If I want that, if I press this button, it will clear this one and the entering several make a function here. For this button which is clear. This one, this is a grid. Where is it clear this one I will make Command, command equal. I want clear. Clear on iOS, call it clear on for the moment. Now. We will put it here. So we have deaf clear, not clear. It is clear, clear. Or now this one here, what we will do, we will clear the frame, so we'll just use this function that will clear, clear all the children's, that's food frame has kit are Hutchinson's now will make the were cleared the entry. So we will just make, which is the entry which is fine name than that, deletes from 0 to the end, from 0 to the end. So clear everything. We'll try it for example, here we have this picture. Now, we did, I'm sorry, we didn't write the name. I will put just this one. I would take this picture if I were press clear, you see that there is no no-name and now picture. So that was the application that I told you about we have created, as you can see, this is the first one and that's what we do together. I am proud of you and I think that this is the end of this course, and I hope that you understand a lot of things with me. You have questions and you have anything you can let us in the comments or you can send me an email for this. And I will be always, they always here for you. So I see you in the next course and stay safe by.