Why the PNG gAMA Chunk Changes Image Brightness
See how two PNGs with identical pixel data can look lighter or darker, how to check the gAMA chunk, and when an sRGB export can fix the mismatch.
On this page
If one copy of a PNG looks lighter or darker, compare how the two files describe their color before editing the artwork. The PNG gAMA chunk is optional metadata that describes how stored color samples relate to the intended display intensity. A decoder that uses it can produce different brightness from identical stored RGB values. The PNG specification's gAMA section defines the tag and how its value is stored.
Check gAMA alongside other color metadata. An sRGB tag, embedded ICC profile, or cICP color signal can take precedence when the decoder understands it. Keep a copy of the original so you can compare the numbers and the appearance after each export.
Same PNG samples, different decoded gray
We built two 8-bit RGBA PNGs with the same dimensions and byte-for-byte identical IDAT payloads. IDAT holds the compressed image data. The files used gAMA values of 0.45455 and 1.00000, stored as the integers 45455 and 100000. Neither file contained another color tag.
With gamma correction off, the files decoded to identical RGBA bytes. Then we used png_set_gamma() in libpng 1.6.59 to apply each file's gamma against the same output gamma of 2.2. The libpng manual shows how to read the file's gamma and pass it to the decoder.
The center swatch stored RGB (128, 128, 128) in both PNGs. With gamma correction on, libpng returned (128, 128, 128) for gAMA 0.45455 and (186, 186, 186) for gAMA 1.00000. Every alpha sample matched across both files, including a value of 96 in the partially transparent band.

That result belongs to this decoder and its settings. A viewer using a different color pipeline can produce different numbers, so compare your own files in the app that will actually display them.
Check gAMA before changing the export
- Compare both PNGs in the same app on the same background. Pick a flat, fully opaque midtone as your first checkpoint. If the shift is only visible along translucent edges, compare those edges on a second background and inspect the alpha channel as well.
- Inspect both files' color metadata. With ImageMagick installed, run the command below. Compare the
png:gAMAproperty where present, then look for ansRGBchunk or an embedded profile. ImageMagick's Identify documentation explains the metadata view. A PNG chunk inspector can confirm which tags are actually in the file. - Compare the stored samples if the cause is still unclear. Use a decoder with color transforms disabled to compare the same pixel in both files. Differing
IDATbytes can result from different compression or filtering, so compare decoded samples before concluding that the pixels changed. If samples match and color tags differ, test the files with color management on in the destination.
magick identify -verbose "before.png" "after.png"Re-export from a source with known color
If the source has a known color space and the destination expects sRGB, use your editor's color conversion to export a fresh sRGB copy. Convert the colors to sRGB and include the corresponding color information on export. Assigning a different profile without converting tells the next app to interpret the existing RGB numbers differently.
Avoid deleting gAMA on sight. The PNG color chunk priority table places gAMA below other supported color tags. If an embedded profile or sRGB is in charge, editing gAMA alone may do nothing in that decoder. If gAMA is the file's only color tag, stripping it can leave the viewer to make its own assumption.
Open the new export in the destination and compare the same midtone and transparent edge against the reference. If the shift only begins after an SVG export, use the SVG export color troubleshooting guide to inspect paint and color conversion there. If you also need paths, the PNG-to-SVG quality guide shows how to judge the traced result.
FAQ
Is a gAMA value of 0.45455 the same as an sRGB tag?
No. It is the PNG specification's recommended fallback gamma value for an sRGB file. An sRGB chunk explicitly identifies the full sRGB color space.
Does gAMA change PNG transparency?
Gamma correction applies to the color samples. Alpha represents opacity and stays separate. A translucent edge can still look lighter or darker because its underlying RGB color changed.
Can removing gAMA fix the brightness shift?
It may change the result in a particular viewer, depending on what other color information is present and what the viewer assumes without the tag. Start from a source with known color, export for the destination, and verify the appearance there.
Start with the PNG whose color you trust
PerfectVector can turn flat raster artwork into editable SVG paths. Resolve the PNG's color interpretation before tracing so you have a reference for the vector result.
If the job also needs editable artwork, vectorize your verified source PNG and compare a flat fill in the resulting SVG with the same swatch in the approved PNG. Keep the PNG as the color reference.
Sources
- W3C — Portable Network Graphics specification — Defines image gamma, color chunk precedence, sRGB signaling and the separate alpha channel.
- libpng manual — Gamma handling — Documents the decode controls used in the controlled comparison.
- ImageMagick — Identify — Explains how to inspect individual image properties with verbose output.
More from the blog
Indexed PNG vs. RGB PNG: Check Color and Alpha
Tell indexed PNG from RGB and RGBA PNG, check palette transparency, and see why changing the mode cannot restore a color removed from the palette.
Read PNG pHYs to Check Print Size and Resolution
Read PNG pHYs metadata, convert pixels per meter to pixels per inch, and calculate the suggested print size. Check what to do when the density is missing.


