2015-10-02 | Paul Boddie | raw files shortlog changelog graph | Use a proper main program! | |
dither.py (file) |
1.1 --- a/dither.py Fri Oct 02 19:22:17 2015 +0200 1.2 +++ b/dither.py Fri Oct 02 23:43:11 2015 +0200 1.3 @@ -17,8 +17,9 @@ 1.4 def dither(im, imp=None): 1.5 return im.quantize(palette=imp or get_palette()) 1.6 1.7 -im = PIL.Image.open(sys.argv[1]) 1.8 -im2 = dither(im) 1.9 -im2.save(sys.argv[2]) 1.10 +if __name__ == "__main__": 1.11 + im = PIL.Image.open(sys.argv[1]) 1.12 + im2 = dither(im) 1.13 + im2.save(sys.argv[2]) 1.14 1.15 # vim: tabstop=4 expandtab shiftwidth=4