Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python resize image

from PIL import Image
image = Image.open("path/.../image.png")
image = image.resize((500,500),Image.ANTIALIAS)
image.save(fp="newimage.png")
Comment

pyhton image resize

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()
Comment

image resize in python

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()
Comment

pyhton image resize

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)
Comment

PREVIOUS NEXT
Code Example
Python :: python check for alphanumeric characters 
Python :: read pickle file 
Python :: pytest - parameterizing tests 
Python :: logarithms python 
Python :: python enum to int 
Python :: convert datetime to date pandas 
Python :: increment decrement operator in python 
Python :: jupyter notebook GET 500 
Python :: calculate quartil python 
Python :: python 2d dictionary 
Python :: convert integer to binary in python 
Python :: clear list 
Python :: django trim string whitespace 
Python :: python change audio output device 
Python :: jinja if or 
Python :: tkinter maximise window 
Python :: how to redirect user in flask response python 
Python :: create app in a django project 
Python :: python write byte 
Python :: console-based animation-simple 
Python :: create random phone number python 
Python :: Converting Dataframe from list Using a list in the dictionary 
Python :: poppler on colab 
Python :: create an array with a range of elements 
Python :: big comments python 
Python :: turtle example 
Python :: convert list of lists to numpy array matrix python 
Python :: how to append to a dictionary in python 
Python :: variables and data types in python 
Python :: download unsplash images python without api 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =