Skip to content

Instantly share code, notes, and snippets.

@ghandic
Created July 12, 2018 08:08
Show Gist options
  • Save ghandic/ea06c97eab8b4fdb2f5b295c6949debc to your computer and use it in GitHub Desktop.
Save ghandic/ea06c97eab8b4fdb2f5b295c6949debc to your computer and use it in GitHub Desktop.
Save image as png with metadata
from PIL import Image
from PIL.PngImagePlugin import PngInfo
im = Image.open('example.png')
im_info = PngInfo()
im_info.add_text('Key Information', 'Value Information')
im.save('example.png', pnginfo=im_info)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment