Jump to content

PNG files appearing too dark when inserted into Word or PDF documents because of "Gamma" metadata


Recommended Posts

Hello Community,

 

I've encountered a persistent problem with PNG files created in and saved from paint.net. When these PNG files are inserted into documents such as Word or PDF, they appear significantly darker than the original image. After some investigation, I found the issue is related to a gamma value that paint.net seems to be writing into the PNG files by default.

 

My observations:

  1. This darkening effect occurs consistently with PNG files created in paint.net.
  2. The same images, when converted to other formats like TIFF or JPEG, do not exhibit this problem.
  3. The issue persists across different versions of Word and various PDF readers.

 

To further illustrate this issue, I've conducted a more detailed analysis:


Here is an analysis of an original PNG file created and saved directly from paint.net. The image is shown below.
image.thumb.png.8feb3917a114dc1209db9c2035a0e6f0.png


Here is an analysis of the same image, first saved as TIFF from paint.net, then converted to PNG using external software.

image.thumb.png.290a75976d848328a13162dc6f1ed6db.png
The first file (direct PNG from paint.net) exhibits the described problem of appearing too dark when inserted into Word or PDF documents. In contrast, the second file (TIFF to PNG conversion) appears perfectly fine after insertion in such documents.


This demonstrates that the issue lies within the PNG file creation process in paint.net, rather than with the image data itself or the insertion process in Word or PDF software.

 

The above-linked analysis by ExifInfo shows that the root cause is a gamma value (of 2.8985) being written into the PNG file metadata by paint.net. This gamma value is apparently not being interpreted correctly (or not as intended) by Word or PDF software, resulting in the darker appearance.

 

My questions for the community and developers:

  1. Is there a way to prevent paint.net from writing a gamma value into PNG files upon saving?
  2. If not, could this feature be considered for future updates? Perhaps as an optional setting when saving PNG files?
  3. Are there any workarounds within paint.net to mitigate this issue?

 

I understand that gamma correction can be beneficial for image quality in many cases. However, for my specific workflow, it's causing more problems than it solves.

 

Any insights, suggestions, or potential solutions would be greatly appreciated.

 

Thanks @all for your time and assistance.

 

Best regards,

David

Edited by DavidP
typo
Link to comment
Share on other sites

  • DavidP changed the title to PNG files appearing too dark when inserted into Word or PDF documents because of "Gamma" metadata

Can you share the images themselves? I tried downloading the images you posted but they're saving as WebP for some reason. Maybe attaching them in a ZIP file would help. I haven't been able to reproduce this issue on my own yet; I see the gamma being written as 2.2*, which is the correct value.

 

* the value in the gAMA metadata is actually 45455

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Sure, here are the original files! Thanks for looking into it.

 

Could it be that the reason for the problem is that the image was originally taken from a PDF by calling paint.net directly from within the PDF software? 

 

I've added that original image as well to the attached zip folder.

 

Sample image versions.zip

 

Edited by DavidP
adding stuff
Link to comment
Share on other sites

For the image, "Sample image created in paint.net and saved as PNG", it's not actually clear to me that it was indeed saved by Paint.NET.

 

It does not have the metadata stating what software created it, and it has a color profile attached to it called "opRGB" aka Adobe RGB (1998). If a PNG is saved by Paint.NET then it will definitely have the creation software metadata. So whatever actually created that PNG is doing something weird, particularly because the gamma value for Adobe RGB (1998) is the standard 2.2, not 2.8whatever.

 

Paint.NET never specifies a gAMA value when saving a PNG, nor does it even read the value from the metadata. There's only a few bits of PNG metadata that are supported, and one of those is the color profile. In PDN v5.0 the color profile isn't used by PDN, and there is no mechanism for specifying it. In v5.1 you can do that though. So one thing you can try is to install the latest PDN v5.1 beta and see if things change.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...