(img, factor)
return img.resize(newsize)
Resizes an image |img| by a certain |factor|.
    For instance a 400x200 img will be reduced to 200x100 if given factor 2.
Resizes an image |img| by a certain |factor|.
    For instance a 400x200 img will be reduced to 200x100 if given factor 2.
Resizes an image |img| by a certain |factor| . For instance a 400x200 img will be reduced to 200x100 if given factor 2 .
def resize(img, factor):
    """Resizes an image |img| by a certain |factor|.
    For instance a 400x200 img will be reduced to 200x100 if given factor 2.
    """
    newsize = (img.size[0] // factor, img.size[1] // factor)
    return img.resize(newsize)
def resize ( img , factor ) : newsize = ( img . size [ 0 ] // factor , img . size [ 1 ] // factor ) return img . resize ( newsize )