roniemartinez / libqpsd

PSD (Photoshop Document) & PSB (Photoshop Big) Plugin for Qt/C++ (Qt4/Qt5)
GNU Lesser General Public License v2.1
108 stars 25 forks source link

Incorrect reading images with transparent pixels #15

Open stepanp opened 9 years ago

stepanp commented 9 years ago

I have some psd file with transparency background. I try load it with libqpsd, but some pixels with opacity displays incorrect: test Left - psd file, loaded with libqsd, right - png file saved from same psd file using photoshop. Psd file format: RGB color, 8-bits per channel, Photoshop CS5. Same thing has in all my psd files having non-white transparent pixels.

stepanp commented 9 years ago

I found fix: https://github.com/brendan-duncan/image/issues/28 https://github.com/brendan-duncan/image/blob/master/lib/src/formats/psd/psd_image.dart, line 544

Pull request here: https://github.com/Code-ReaQtor/libqpsd/pull/16

roniemartinez commented 9 years ago

Hi, Do you think the bug can also be found in other color depths (e.g. 16)?

stepanp commented 9 years ago

Hi.

Yes, i think this bug can be found in all color dephts. Photoshop store merged image with blending it with white. So, if image have transparent background, this bug is possible.

For 16 bits, I think, same fix could be used.