''' Purpose: support image mirroring transformation ''' def upleft( image ) : ''' Returns the size of a new image that is one-half of the original image's width and height ''' ow, oh = original.size # get original image dimensions nw, nh = ow // 2, oh // 2 result = ( nw, nh ) return result if ( __name__ == '__main__' ) : import url from manip import manip # get web image of interest link = "http://www.cs.virginia.edu/~cs1112/images/mandrill/full.png" original = url.get_image( link ) new_image = manip( original, size=upleft ) new_image.show()