''' Provides a sandbox for image transformations ''' from PIL import Image # get Pillow Image capabilities import locate, mutate, dimensions # get our modules for image transformations def play( original ) : ow, oh = original.size # get dimensions of the original nw, nh = ... # set dimensions of the new image # get a new appropriately sized image and fill it in new_image = Image.new( 'RGB', ( nw, nh ) ) for nx in range( 0, nw ) : # consider all possible x values for new image for ny in range( 0, nh ) : # consider all possible y values for new image nspot = ( nx, ny ) # set the spot to be filled in new image ospot = ... # determine corresponding spot in original opixel = original.getpixel( ospot ) # get the pixel at the ospot npixel = ... # determine pixel for the new image new_image.putpixel( nspot, npixel ) # set the nspot in the new image return new_image # return the filled in new image def blue( orig ) : ''' Return a new blueing of orig ''' ... return new_image if ( __name__ == '__main__' ) : import url # get web image of interest link = "http://www.cs.virginia.edu/~cs1112/images/mandrill/full.png" orig = url.get_image( link ) original.show()