pngmeta

Python library for PNG metadata

Read and write PNG text chunks, XMP, and metadata with ease

--
GitHub Stars
--
PyPI Downloads
0
Dependencies

Why pngmeta?

🚀

Simple API

Dictionary-style access makes it easy to read and write metadata. Similar to iptcinfo3 for a familiar experience.

📦

Zero Dependencies

Pure Python implementation with no external dependencies. Just install and use.

Full PNG Support

Handles tEXt, iTXt, and zTXt chunks. Complete support for UTF-8 and compressed text.

🎨

XMP Compatible

Read and write XMP metadata in PNG files for cross-format compatibility.

Fast & Efficient

Minimal overhead. Metadata typically adds only 100-2000 bytes to file size.

🔓

Public Domain

Released under Unlicense. Use it however you want, commercially or personally.

Installation

pip install pngmeta

Or with uv:

uv pip install pngmeta

Quick Example

from pngmeta import PngMeta

# Open an image
meta = PngMeta('photo.png')

# Read metadata
print(meta['Title'])
print(meta['Author'])

# Add metadata
meta['Title'] = 'Sunset Over Mountains'
meta['Author'] = 'Jane Photographer'
meta['Copyright'] = '© 2025 Jane'

# Save changes
meta.save()

# Or save to new file
meta.save('photo_with_metadata.png')

It's that simple!

  • ✓ Dictionary-style access
  • ✓ Read existing metadata
  • ✓ Add or modify fields
  • ✓ Save in-place or to new file
  • ✓ Works with any PNG image
View More Examples →

Comprehensive Metadata Support

Standard Fields

  • Title
  • Author
  • Description
  • Copyright
  • Creation Time
  • Software
  • Comment
  • + Any custom field

PNG Chunks

  • tEXt - Latin-1 text
  • iTXt - UTF-8 text
  • zTXt - Compressed text
  • Automatic chunk selection
  • Proper CRC calculation
  • Standards compliant

XMP Support

  • Read XMP metadata
  • Write XMP data
  • Adobe XMP format
  • Cross-format compatible
  • Structured metadata
  • Industry standard

Latest Release

Loading...

v0.1.0

Fetching release information...

Documentation

Similar to iptcinfo3

If you're familiar with iptcinfo3, you'll feel right at home with pngmeta.

iptcinfo3 (JPEG)

from iptcinfo3 import IPTCInfo

info = IPTCInfo('photo.jpg')
info['caption/abstract'] = 'Caption'
info.save()

pngmeta (PNG)

from pngmeta import PngMeta

meta = PngMeta('photo.png')
meta['Description'] = 'Caption'
meta.save()