Horje
pil resize image Code Example
python pil resize image
from PIL import Image

# Image.open() can also open other image types
img = Image.open("some_random_image.jpg")
# WIDTH and HEIGHT are integers
resized_img = img.resize((WIDTH, HEIGHT))
resized_img.save("resized_image.jpg")
python pillow resize image
from PIL import Image
# set the base width of the result
basewidth = 300
img = Image.open('somepic.jpg')
# determining the height ratio
wpercent = (basewidth/float(img.size[0]))
hsize = int((float(img.size[1])*float(wpercent)))
# resize image and save
img = img.resize((basewidth,hsize), Image.ANTIALIAS)
img.save('sompic.jpg') 
pil resize image
im = Image.open('image.jpg')  
im = im.resize((w, h)) 
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)
Source: pypi.org




Python

Related
dataframe of one row Code Example dataframe of one row Code Example
python speech to text Code Example python speech to text Code Example
sapi5 python Code Example sapi5 python Code Example
stingray Code Example stingray Code Example
check django version windows Code Example check django version windows Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7