There are several ways colorspace metadata can be included in a PNG.
- No colorspace metadata (software should assume sRGB)
- Built-in sRGB format chunk
- gAMA chunks
- cHRM chunks
- ICC profile chunks
IMO v4 ICC profiles are the modern and best way to encode colorspace info. The problem is not all software uses any or all of these.
ffmpeg for example decodes all of these chunks but does not actually use any of it. It even assumes by default PNGs are encoded with rec.701 gamma (common for legacy video). This is why PNG->x264 conversion with ffmpeg has weird colors unless you encode the PNGs with gamma ~2.0 instead of the sRGB standard ~2.2.
- No colorspace metadata (software should assume sRGB)
- Built-in sRGB format chunk
- gAMA chunks
- cHRM chunks
- ICC profile chunks
IMO v4 ICC profiles are the modern and best way to encode colorspace info. The problem is not all software uses any or all of these.
ffmpeg for example decodes all of these chunks but does not actually use any of it. It even assumes by default PNGs are encoded with rec.701 gamma (common for legacy video). This is why PNG->x264 conversion with ffmpeg has weird colors unless you encode the PNGs with gamma ~2.0 instead of the sRGB standard ~2.2.