Why does a Photoshop Difference blend show changes after saving a PNG if PNG is lossless?
Asked 8/15/2014
3 views
2 answers
0
I tested PNG losslessness in Photoshop by exporting an image with Save for Web as PNG-24, then placing that PNG back into the original PSD as a new layer and setting the blend mode to Difference. I expected a completely black result if the PNG was identical, but I saw visible differences.
I tried options like converting or not converting to sRGB and including transparency, but the result changed depending on the workflow. In particular, when my document was in Adobe RGB, the placed PNG differed; after converting the document to sRGB before export, the Difference result became black.
If PNG is lossless, why would this happen? Is PNG changing the pixels, or is Photoshop doing a color-space conversion during export/import?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
11y ago
2 Answers
2
I did some more tests and I think the issue is color space conversion. Here's the testing procedure I used with Photoshop CC 2014:
- Create a new file with 8-bit, Adobe RGB 1998 color space.
- Create a rainbow gradient.
- Save for Web as PNG; don't convert to sRGB.
- Place embedded the PNG file just saved.
- Change PNG layer blend mode to difference. There is a very noticeable difference (not all black). So, the PNG file is not the same as the original.
Then, I did the following procedure:
- Create a new file with 8-bit, Adobe RGB 1998 color space.
- Create a rainbow gradient.
- Edit -> Convert to Profile with Destination Space: sRGB
- Save for Web as PNG; don't convert to sRGB.
- Place embedded the PNG file just saved.
- Change PNG layer blend mode to difference. The appearance is solid black indicating that the two layer are the same.
So, this implies that Save for Web as PNG saves in sRGB color space even if you don't check the Convert to sRGB checkbox. I believe you'll get a better color conversion if you do check this checkbox or if you do the separate Convert to Profile steps as in 3. above. But it looks like you get sRGB either way. Unfortunately, Save for Web as PNG fails to embed a color profile or tag regardless of whether you check the box or not. Also, regardless of whether you do Convert to Profile or not.
Originally by user28069. Source · Licensed CC BY-SA 4.0
user28069
11y ago
0
Generated from our catalog & community — verify before relying on it.
PNG compression itself is lossless, so the pixel values can be preserved exactly. The difference you saw is most likely from color management, not from PNG compression.
In your tests, the mismatch appeared when the original document was Adobe RGB and disappeared after converting the image to sRGB before saving. That points to Photoshop exporting or re-importing the PNG in a different color space/profile than the original layer. When two layers are numerically identical but interpreted through different profiles, a Difference blend can show visible changes.
So the short answer is: PNG is not the problem. The likely cause is Photoshop’s handling of ICC profiles / color-space conversion in the Save for Web + Place workflow. If you want a true pixel-for-pixel comparison, make sure both the original and the imported PNG are in the same color space and profile, with no conversion happening on export or import.
Recommended products
UniqueBot
AI11y ago
Your Answer
Related Questions
Photoshop JPEG export: Save As vs Save for Web, and what should you keep for printing?
Does TIFF offer higher image quality than PNG, and when would converting lose quality?
Can you create a duotone in Photoshop with adjustment layers instead of changing image mode?
Does converting a JPEG to PNG help preserve quality when editing Fuji JPEGs?
In Photoshop, is Adobe ACE more accurate than Microsoft ICM for color profile conversions?