Installation
In order to proceed you must have python
installed on your machine and then you must install pillow
library on your system like this
pip install pillow
After installing pillow you create a app.py
file and copy paste the following code
app.py
1 2 3 4 5 |
from PIL import Image image = image.open("input.jpg") image.save("output.png") |
Here we have used the open
method to first of all open the image and then we have used the save
method to convert the image from jpg to png
. You can also do the reverse process as well.
Now for running this python script you just need to run the following command
python app.py