Answers for "image processing and resizing with python"

0

image processing and resizing with python

image = Image.open('demo_image.jpg')
logo = Image.open('logo.png')
image_copy = image.copy()
position = ((image_copy.width - logo.width), (image_copy.height - logo.height))
image_copy.paste(logo, position)
image_copy.save('pasted_image.jpg')
Posted by: Guest on June-29-2021
0

image processing and resizing with python

image = Image.open('demo_image.jpg')

image_rot_90 = image.rotate(90)
image_rot_90.save('image_rot_90.jpg')

image_rot_180 = image.rotate(180)
image_rot_180.save('image_rot_180.jpg')
Posted by: Guest on June-29-2021
0

image processing and resizing with python

image = Image.open('demo_image.jpg')
box = (200, 300, 700, 600)
cropped_image = image.crop(box)
cropped_image.save('cropped_image.jpg')

# Print size of cropped image
print(cropped_image.size) # Output: (500, 300)
Posted by: Guest on June-29-2021

Browse Popular Code Answers by Language