How to save image metadata in PNG files using Python? or Best way to save image metadata to PNG with

18 Replies, 1773 Views

lol i feel your pain. spent *hours* on this last week.

Pillow works but is picky. Try this:

```python
meta = {"Description": "My cool image"}
img.save("out.png", pnginfo=Image.PngInfo().add_text(*meta.items()))
```

Weird, right? But it sticks.

Messages In This Thread



Users browsing this thread: 1 Guest(s)