Answers for "python save pil image"

10

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")
Posted by: Guest on April-05-2020
0

pil save image

from PIL import Image

newImg1 = Image.new('RGB', (512,512))
newImg1.save("img1.png")
Posted by: Guest on May-12-2021
0

save python dic

import pickledict = {'Python' : '.py', 'C++' : '.cpp', 'Java' : '.java'}f = open("file.pkl","wb")pickle.dump(dict,f)f.close()
Posted by: Guest on April-27-2020

Python Answers by Framework

Browse Popular Code Answers by Language