PSD cannot be converted to PNG without dodgy alpha (white blended in with alpha)

Reported bugs that have been closed and/or resolved

Moderators: XnTriq, xnview, Dreamer

Post Reply
User avatar
Clonkex
Posts: 6
Joined: Thu Apr 06, 2017 10:59 pm

PSD cannot be converted to PNG without dodgy alpha (white blended in with alpha)

Post by Clonkex » Tue Aug 27, 2019 3:58 am

Hi,

I need to convert a LOT of simple one-layer PSDs to PNG. Both XnConvert and Sagethumbs work fantastically for this, but since I also need to resize a lot of them I usually use XnConvert.

I've started noticing an issue, however. It seems that with transparent PSDs, both XnConvert and Sagethumbs convert the alpha with some white blended in. I believe Sagethumbs is based on the GFL SDK, which would explain why it gives the same results as XnConvert.

After a bit of googling and a lot of frustration I discovered a mention of this same issue in the ImageMagick source: https://github.com/ImageMagick/ImageMag ... psd.c#L276
For some reason Photoshop seems to blend semi-transparent pixels with white.
This method reverts the blending. This can be disabled by setting the
option 'psd:alpha-unblend' to off.
It seems like Photoshop does something weird with alpha blending, and ImageMagick has a function called CorrectPSDAlphaBlend that corrects that. Would it be possible to have an option in XnConvert to do the same thing? I'd be over the moon if XnConvert could convert transparent PSDs to PNG without breaking the transparency! :D

Attached is an example PSD, created with Photoshop CC 20.0.4, along with the PNG result from XnConvert and some screenshots of the original and converted files in Photoshop with red backgrounds so you can see the dodgy white line around the converted one. The forum wouldn't let me attach the original PSD directly so I've zipped it first.

Let me know if you need more info. Thanks!
Attachments
original.zip
(320.19 KiB) Downloaded 13 times
screenshot of original with red background.png
screenshot of converted with red background, after importing back into photoshop.png
converted from psd to png by xnconvert.png
converted from psd to png by xnconvert.png (102.99 KiB) Viewed 298 times

User avatar
xnview
Author of XnView
Posts: 31881
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: PSD cannot be converted to PNG without dodgy alpha (white blended in with alpha)

Post by xnview » Mon Sep 02, 2019 3:31 pm

could you post a good and bad result file?
Pierre.

User avatar
Clonkex
Posts: 6
Joined: Thu Apr 06, 2017 10:59 pm

Re: PSD cannot be converted to PNG without dodgy alpha (white blended in with alpha)

Post by Clonkex » Mon Sep 02, 2019 10:31 pm

Good idea. Attached. One is saved as PNG directly from Photoshop, the other is from converting original.psd to PNG with XnConvert.

The best way to see the issue is to load each of them into some image editing program and add a solid red layer underneath the "hello world" layer. That way you'll be able to see the white outline around XnConvert's result.
Attachments
pngfromxnconvert.png
pngfromxnconvert.png (102.99 KiB) Viewed 212 times
pngfromphotoshop.png
pngfromphotoshop.png (80.21 KiB) Viewed 212 times

User avatar
xnview
Author of XnView
Posts: 31881
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: PSD cannot be converted to PNG without dodgy alpha (white blended in with alpha)

Post by xnview » Tue Sep 03, 2019 12:19 pm

See issue for current status and some details.
Pierre.

User avatar
xnview
Author of XnView
Posts: 31881
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: PSD cannot be converted to PNG without dodgy alpha (white blended in with alpha)

Post by xnview » Tue Sep 17, 2019 10:15 am

This problem is supposed to be fixed in XnView MP 0.94. Please check and confirm the bug fix here.
Pierre.

User avatar
Clonkex
Posts: 6
Joined: Thu Apr 06, 2017 10:59 pm

Re: PSD cannot be converted to PNG without dodgy alpha (white blended in with alpha)

Post by Clonkex » Tue Sep 17, 2019 10:42 pm

Can confirm, this problem is fixed in XnView MP 0.94 beta 1 :)

Post Reply