from PIL import Image
image = Image.open("path/.../image.png")
image = image.resize((500,500),Image.ANTIALIAS)
image.save(fp="newimage.png")
from PIL import Image
from resizeimage import resizeimage
fd_img = open('test-image.jpeg', 'r')
img = Image.open(fd_img)
img = resizeimage.resize_cover(img, [200, 100])
img.save('test-image-cover.jpeg', img.format)
fd_img.close()
from PIL import Image, ImageFilter # Import classes from the library.
original_image = Image.open("file.ppm") # Load an image from the file system.
blurred_image = original_image.filter(ImageFilter.BLUR) # Blur the image.
# Display both images.
original_image.show()
blurred_image.show()
from PIL import Image
from resizeimage import resizeimage
with open('test-image.jpeg', 'r+b') as f:
with Image.open(f) as image:
cover = resizeimage.resize_cover(image, [200, 100])
cover.save('test-image-cover.jpeg', image.format)