Skip to content
Commit 402dfb5d authored by Mirco Miranda's avatar Mirco Miranda Committed by Albert Astals Cid
Browse files

psd: Fix alpha blending

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.
parent a3f7c03b
Pipeline #366489 passed with stage
in 3 minutes and 36 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment