def main( argv ): ''' This creates a collage of 5 images with the first element of each innerlist being the filename of the image you want to include in the collage, the second and third being the x and y positions of each image depending on its size, the fourth being the filter applied to each filter. The fifth index is the alpha blend of each picture, the sixth is whether you want to remove the backgound or not and the last one is the pixmap object after the image is read in. The images included in the collage depend on user input. ''' if len(argv) < 6: print len(argv) print "Not enough input" exit() clist=[ [argv[1], 0, 0, 'reversepixels', 1.0, False, None], [argv[2], 0, 150, 'mirrorvert', 0.7, False,None ], [argv[3], 300, 100, 'swapRedBlue', 0.6, False,None], [argv[4], 500,-200, 'original', 0.6, True, None], [argv[5],400,20,'negative', 0.7,False,None] ] collage.readImages( clist ) dest=collage.buildCollage( clist ) dest.save( 'testcollage.ppm' ) return
def main(argv): if len(argv) < 6: print len(argv) print "Not enough input" exit() clist = [[argv[1], 0, 0, 'swapRedBlue', 1.0, False, None], [argv[2], 0, 150, 'quarterBlueHalfGreen', 0.5, False, None], [argv[3], 300, 100, 'grayscale', 0.6, True, None]] collage.readImages(clist) dest = collage.buildCollage(clist) dest.save('testcollage.ppm') return
def main(argv): if len(argv) < 6: print 'You need more command line files you dumb dumb' '''new clist with command line files''' clist = [[argv[1], 0, 0, 'swapRedBlue', .90, False, None], [argv[2], 400, 400, 'colorNegative', 0.75, False, None], [argv[3], 0, 350, 'purpleHaze', 0.65, False, None], [argv[4], 450, 0, 'moreGreen', 0.50, False, None], [argv[5], 125, 50, 'original', 1.0, True, None]] # call readImages collage.readImages(clist) # call buildCollage dst = collage.buildCollage(clist) # save the image dst.save('mycollage.ppm') return
def main( argv ): if len(argv) < 6: print 'You need more command line files you dumb dumb' '''new clist with command line files''' clist = [ [ argv[1], 0, 0, 'swapRedBlue', .90, False, None ], [ argv[2], 400, 400, 'colorNegative', 0.75, False, None ], [ argv[3], 0, 350, 'purpleHaze', 0.65, False, None], [ argv[4], 450, 0, 'moreGreen', 0.50, False, None], [ argv[5], 125, 50, 'original', 1.0 , True, None] ] # call readImages collage.readImages( clist ) # call buildCollage dst = collage.buildCollage( clist ) # save the image dst.save( 'mycollage.ppm' ) return
def main( argv ): if len(argv) < 3: print 'You need more command line files you dumb dumb' '''new clist with command line files''' clist = [ [ argv[1], 0, 0, 'original', .80, False, None ], [ argv[2], 675, 200,'original', 1.0, True, None ], ] # call readImages collage.readImages( clist ) # call buildCollage dst = collage.buildCollage( clist ) # save the image dst.save( 'p5extension1.ppm' ) return
def main( argv ): if len(argv) < 6: print "Not enough input" exit() clist=[ [argv[1], 0, 0, 'swapRedBlue', 1.0, False, None], [argv[2], 150, 150, 'grayscale', 0.5, False, None ] [argv[3], 200, 0, 'swapBluetoYellowRedtoPurple', 0.2, False, None] [argv[4], 0,-150, 'quarterblueHalfGreen', 0.4, True, None] [argv[5],-175,175,'swapRedBlue', 0.7,False,None] collage.readImages( clist ) dst=collage.buildCollage( clist ) dst.save( 'testcollage.ppm' ) return if __name__ == "__main__" main(sys.argv)
def main( argv ): if len(argv) < 6: print 'You need more command line files you dumb dumb' '''new clist with command line files''' clist = [ [ argv[1], 0, 0, 'swapRedBlue', .60, False, None ], [ argv[2], 200, 0,'colorNegative', 0.85, False, None ], [ argv[5], 800, 0, 'swapRedBlue', 0.60, False, None], [ argv[4], 600, 0, 'colorNegative', 0.85, False, None], [ argv[3], 400, 0, 'swapRedBlue', 1.0, False, None] ] # call readImages collage.readImages( clist ) # call buildCollage dst = collage.buildCollage( clist ) # save the image dst.save( 'mycoverphoto.ppm' ) return
def main(argv): if len(argv) < 3: print 'Usage: testbuildcollage.py <ppm image 1> <ppm image 2>' print '\n Reads in the two images and builds a collage' print ' with the second image overlapping the first ' print ' using an alpha blend of 0.5' print '\n The output image is called testcollage.ppm' print exit() # create the collage list with the two images clist = [[argv[1], 0, 0, 'rbswap', 1.0, False, None], [argv[2], 150, 150, 'original', 0.5, False, None]] # call readImages collage.readImages(clist) # call buildCollage dst = collage.buildCollage(clist) # save the image dst.save('testcollage.ppm') return
def main( argv ): if len(argv) < 3: print 'Usage: testbuildcollage.py <ppm image 1> <ppm image 2>' print '\n Reads in the two images and builds a collage' print ' with the second image overlapping the first ' print ' using an alpha blend of 0.5' print '\n The output image is called testcollage.ppm' print exit() # create the collage list with the two images clist = [ [ argv[1], 0, 0, 'rbswap', 1.0, False, None ], [ argv[2], 150, 150, 'original', 0.5, False, None ] ] # call readImages collage.readImages( clist ) # call buildCollage dst = collage.buildCollage( clist ) # save the image dst.save( 'testcollage.ppm' ) return
def main( argv ): if len(argv) == 2: '''new clist with 1 command line files''' clist1 = [ [ argv[1], 0, 0, 'colorNegative', 1.0, False, None ], ] # call readImages collage.readImages( clist1 ) # call buildCollage dst = collage.buildCollage( clist1 ) # save the image dst.save( 'p5extension3a.ppm' ) #for 3a i used snorlax.ppm elif len(argv) == 4: '''new clist with 3 command line files''' clist2 = [ [ argv[1], 0, 0, 'swapRedBlue', .90, False, None ], [ argv[2], 600, 0, 'colorNegative', 0.75, False, None ], [ argv[3], 300, 0, 'purpleHaze', 0.65, False, None], ] # call readImages collage.readImages( clist2 ) # call buildCollage dst = collage.buildCollage( clist2 ) # save the image dst.save( 'p5extension3b.ppm' ) #for 3b i used stephcurry.ppm else: '''new clist with 5 command line files''' clist3 = [ [ argv[1], 0, 0, 'swapRedBlue', .90, False, None ], [ argv[2], 400, 500, 'colorNegative', 0.75, False, None ], [ argv[3], 0, 500, 'purpleHaze', 0.8, False, None], [ argv[4], 400, 0, 'moreGreen', 0.50, False, None], [ argv[5], 125, 100, 'original', 1.0 , True, None] ] # call readImages collage.readImages( clist3 ) # call buildCollage dst = collage.buildCollage( clist3 ) # save the image dst.save( 'p5extension3c.ppm' ) #for 3c i used me.ppm and myface.ppm return