1 2 3 4 5 6 7 8 9 10 11
#!/usr/bin/env python import os, sys, argparse from PIL import Image, PngImagePlugin parser = argparse.ArgumentParser(description='Print PNG metadata') parser.add_argument('image', type=str) args = parser.parse_args() img = Image.open(args.image) for k, v in img.info.items(): print('{:15}: {}'.format(k, v))