“Ubah Ukuran Gambar Python” Kode Jawaban

gambar ukuran 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

gambar pujian 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

Ubah Ukuran Gambar 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

Gambar Ubah Ukuran Bantal 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 UKURAN gambar

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

Ubah Ukuran Gambar Python

from PIL import Image
img=Image.open("Me.jpg")
new_size = img.resize((100,1300))
new_size.show()
new_size.save(r'D:/Pics/Us/Fam/me.jpg')
Hurt Herring

Jawaban yang mirip dengan “Ubah Ukuran Gambar Python”

Pertanyaan yang mirip dengan “Ubah Ukuran Gambar Python”

Lebih banyak jawaban terkait untuk “Ubah Ukuran Gambar Python” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya