Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 568 Bytes

File metadata and controls

19 lines (15 loc) · 568 Bytes

install python from your vscode marketplace

install the required module for the task 'py -m pip install pillow'

import module (with an alias if you wish)

from PIL import Image as img

save the picture file path into a variable

my_pic = "picture file path on your pc"

define your function with two arguments

def resize(copy, size):

copy the image

img_copy = img.open(copy)

resize the image

img_size = img_copy.resize(size)

show the image with its new size

return img_size.show()

call the function with the right arguments