pillow show image code example
Example 1: python display image
from PIL import Image, ImageFilter
img1 = Image.open('dlc3.jpg')
filtered_img1 = img1.filter(ImageFilter.BLUR)
filtered_img1.save('Blurdlc3.png')
img2 = Image.open('dyonisos.jpg')
filtered_img2 = img2.filter(ImageFilter.SMOOTH)
filtered_img2.save('dyonisossmooth.png')
img3 = Image.open('shark.jpg')
filtered_img3 = img3.convert('L')
filtered_img3.rotate(180)
filtered_img3.save('Shark.jpg')
Example 2: pil resize image
im = Image.open('image.jpg')
im = im.resize((w, h))
Example 3: pil python image
from PIL import Image
im = Image.open("bride.jpg")
im.rotate(45).show()
Example 4: save imag epillow
im.save(file + ".thumbnail", "JPEG")