def file_save(fn): if fn.endswith('.WIF'): dir, fn = os.path.split(fn) fn = os.path.join(dir, fn.upper()) towif(wif, fn, W, H) print 'wrote', fn elif fn.lower().endswith('.png'): wif.save(fn) print 'wrote', fn else: pass
brightness.set(brightness_val) brightness.pack(side=LEFT) f.pack() f = Frame(root) Button(f, text='Next', command=load_next_image).pack(side=LEFT) Button(f, text='PNG', command=png_and_next).pack(side=LEFT) f.pack() print sys.argv if len(sys.argv) > 1: fn = sys.argv[1] display_im(fn) print fn root.mainloop() def main(): outfn = fn[:3] + 'bmp' wif_fn = fn[:3] + 'WIF' if False: image_file = Image.open(fn) # open colour image image_file= image_file.convert('L') # convert image to monochrome - this works import ImageEnhance image_file = myEqualize(image_file) image_file= image_file.convert('1') # convert image to black and white image_file = image_file.resize((264, 176)) image_file.save(outfn) towif(image_file, wif_fn)
f.pack() f = Frame(root) Button(f, text='Next', command=load_next_image).pack(side=LEFT) Button(f, text='PNG', command=png_and_next).pack(side=LEFT) f.pack() print sys.argv if len(sys.argv) > 1: fn = sys.argv[1] display_im(fn) print fn root.mainloop() def main(): outfn = fn[:3] + 'bmp' wif_fn = fn[:3] + 'WIF' if False: image_file = Image.open(fn) # open colour image image_file = image_file.convert( 'L') # convert image to monochrome - this works import ImageEnhance image_file = myEqualize(image_file) image_file = image_file.convert('1') # convert image to black and white image_file = image_file.resize((264, 176)) image_file.save(outfn) towif(image_file, wif_fn)