2 """Usage: imago.py file"""
7 from filter import filter
9 class Usage(Exception):
10 def __init__(self, msg):
14 """Main function of the program."""
20 raise Usage('no arguments given')
22 print >>sys.stderr, err.msg
23 print >>sys.stderr, "for help use --help"
26 #TODO exception on empty argument
27 #TODO exception on file error
28 image = Image.open(argv)
29 im_debug.show(image, "original image")
31 im_l = image.convert('L')
32 im_debug.show(im_l, "ITU-R 601-2 luma transform")
34 im_edges = filter(im_l)
35 im_debug.show(im_edges, "edge detection")
37 if __name__ == '__main__':
38 main() #sys.exit(main())