from PIL import Image


def resize(im):
    pic = Image.new('RGB',(im.size[0]//2,im.size[1]//2),(0,0,0))
    for x in range(im.size[0]//2):
        for y in range(im.size[1]//2):
            (r,g,b) = im.getpixel( (x,y) )
            pic.putpixel( (x,y) , (r,g,b) ) 
    return pic

im = Image.open("photo.jpeg")
newpic = resize(im)
im.show()
newpic.show()










8f7917a2e5bff00f3dd25d4edb027fbc9c138985
<mask token>

<mask token>


def resize(im):
    pic = Image.new('RGB', (im.size[0] // 2, im.size[1] // 2), (0, 0, 0))
    for x in range(im.size[0] // 2):
        for y in range(im.size[1] // 2):
            r, g, b = im.getpixel((x, y))
            pic.putpixel((x, y), (r, g, b))
    return pic


<mask token>
im.show()
newpic.show()

<mask token>


def resize(im):
    pic = Image.new('RGB', (im.size[0] // 2, im.size[1] // 2), (0, 0, 0))
    for x in range(im.size[0] // 2):
        for y in range(im.size[1] // 2):
            r, g, b = im.getpixel((x, y))
            pic.putpixel((x, y), (r, g, b))
    return pic


im = Image.open('photo.jpeg')
newpic = resize(im)
im.show()
newpic.show()

from PIL import Image


def resize(im):
    pic = Image.new('RGB', (im.size[0] // 2, im.size[1] // 2), (0, 0, 0))
    for x in range(im.size[0] // 2):
        for y in range(im.size[1] // 2):
            r, g, b = im.getpixel((x, y))
            pic.putpixel((x, y), (r, g, b))
    return pic


im = Image.open('photo.jpeg')
newpic = resize(im)
im.show()
newpic.show()

from PIL import Image


def resize(im):
    pic = Image.new('RGB',(im.size[0]//2,im.size[1]//2),(0,0,0))
    for x in range(im.size[0]//2):
        for y in range(im.size[1]//2):
            (r,g,b) = im.getpixel( (x,y) )
            pic.putpixel( (x,y) , (r,g,b) ) 
    return pic

im = Image.open("photo.jpeg")
newpic = resize(im)
im.show()
newpic.show()









