Apl Practical 2
Apl Practical 2
Program :
Output :
Program :
#Transposing an image
from PIL import Image
img = Image.open("transpose.jpg")
width, height = img.size
left = 6
top = height / 4
right = 174
bottom = 3 * height / 4
img1 = img.crop((left, top, right, bottom))
newsize = (200, 200)
img1 = img1.transpose(Image.FLIP_LEFT_RIGHT)
img1.show()
Output :
Program :
Output :
Program :
#Creating a thumbnail
from PIL import Image
img = Image.open("thumbnail.jpg")
MAX_SIZE = (100, 100)
img.thumbnail(MAX_SIZE)
img.show()
Output :