“obraz rozmiaru poduszki w Python” Kod odpowiedzi

obraz rozmiaru Python Pil

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")
Evang

Zmień poduszkę rozdzielczości obrazu

size = 7016, 4961
im = Image.open("my_image.png")
im_resized = im.resize(size, Image.ANTIALIAS)
im_resized.save("my_image_resized.png", "PNG")
Hungry Hamerkop

Zmiana zmiany obrazu Pyhton

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()
Funny Fish

obraz rozmiaru poduszki w Python

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') 
Cute Cardinal

PIL Zmiana zmiany zmiany rozmiaru

im = Image.open('image.jpg')  
im = im.resize((w, h)) 
Johan

Odpowiedzi podobne do “obraz rozmiaru poduszki w Python”

Pytania podobne do “obraz rozmiaru poduszki w Python”

Więcej pokrewnych odpowiedzi na “obraz rozmiaru poduszki w Python” w Python

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu