“Imagen de cambio de tamaño de Python” Código de respuesta

Imagen de cambio de tamaño de Python

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

Imagen de cambio de tamaño de 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

cambiar el tamaño de la imagen de 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

Imagen de cambio de tamaño de almohada de 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

Imagen de cambio de tamaño

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

cambiar el tamaño de la imagen de Pyhton

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

Respuestas similares a “Imagen de cambio de tamaño de Python”

Preguntas similares a “Imagen de cambio de tamaño de Python”

Más respuestas relacionadas con “Imagen de cambio de tamaño de Python” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código