mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-07-25 13:44:21 -04:00
psd: Fix alpha blending (KF5)
PSD files are saved with as alpha premultiplied. The problem is that alpha refers to white instead of black so it requires transformation formulas. Then, to conver PS premultiplied to QImage premultiplied you have to use the following formula: * V = Alpha + Vps - Max (C, M, Y, K, R, G, B, Gray, L\* components) * V = Vps + (Alpha - Max + 1) / 2 (a\*, b\* components) Where Max is the maximum value depending on the image depth and Vps is the valued read from the file. This is a port of MR !143 to KF5.
This commit is contained in:
committed by
Albert Astals Cid
parent
64f3303ef0
commit
e96b43aef5
Binary file not shown.
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 4.9 KiB |
Reference in New Issue
Block a user