39

When I click on the image>property>details of a PNG image in Windows many fields are missing compared to a JPEG file. Are these fields supported in PNG? If so, how would they be added in a PNG file programmatically?

Peter O.
  • 32,158
  • 14
  • 82
  • 96
techno
  • 6,100
  • 16
  • 86
  • 192
  • 1
    check out this http://stackoverflow.com/questions/4497206/how-to-add-extra-meta-data-to-png – david Nov 13 '11 at 17:31

2 Answers2

52

section 11.3.4.2 of the PNG spec gives a list of pre-defined meta tags (keywords)

http://www.w3.org/TR/PNG/#11textinfo

you can add as many other meta tags/fields as you would like.

as for how, programmatically, that depends on the language you're using!

koriander
  • 3,110
  • 2
  • 15
  • 23
Kae Verens
  • 4,076
  • 3
  • 21
  • 41
  • 2
    This was very useful for me in figuring out how to determine whether a PNG image was rotated a la EXIF. In other words, I can't reliably do so... it's good that I didn't bang my head against the wall for too long. – 2rs2ts Oct 22 '13 at 16:36
  • 2
    Unfortunately some image editors (like Corel Photo Paint and The Gimp) decided to completely ignore these text chunks, so if you open a PNG in these image editors, the information is not visible and will be lost if you save the image again. – Waruyama Apr 06 '16 at 07:09
  • Waruyama, GIMP preserves metadata in JPEG files, much more so than other image editors I've used, but I can't vouch for how it handles metadata in other file formats. – Andrew P. Jul 17 '19 at 19:42
16

PNG has no EXIF chunk. Thus EXIF metadata will get lost if you convert from JPEG into PNG.

However Adobe has made XMP for storing all kinds of metadata. So that you can convert between JPEG and PNG while preserving metadata.

neoneye
  • 50,398
  • 25
  • 166
  • 151
  • 7
    As of PNG 1.2 version 1.5 EXIF [has been specified](http://ftp-osl.osuosl.org/pub/libpng/documents/pngext-1.5.0.html#C.eXIf). – Hauke Jun 07 '19 at 08:37