Get Started
Install this library by given below command
pip install pillow
Open Image in Window
In order to open any image in window
1 2 3 4 5 |
from PIL import Image im = Image.open("sample.png") im.show() |
To Convert Image from PNG TO JPG
1 2 3 4 5 |
from PIL import Image im = Image.open('output.png').convert("RGB") im.save("output3.jpg","jpeg") |
Important Methods to Remember
open
method will open the image
convert
method will convert the image
save
method will save the image after conversion