K1TesseraEna wrote:
@saulgoode The alpha value is from the resulting (merged) image. Just wanted to emphasize that the image indeed had an alpha channel.
A PMA pixel has the same alpha channel value as a separate alpha pixel --
"If the separate alpha pixel is (r, g, b, a), then the premultiplied alpha pixel is (ar, ag, ab, a)."K1TesseraEna wrote:
What's your opinion on the technique. Can we really create pixels with PMA this way?
I expressed my doubts but need someone with more knowledge to confirm or prove me wrong.
The technique presented in the tutorial produces the correct result (though it could be done slightly more efficiently).
K1TesseraEna wrote:
And how would you compare the same image before and after adding PMA?
If you had a layer presenting a PMA pixmap, then to view it in its original, "normal" representation, you would:
- Add a layermask initialized using "Transfer layer's alpha channel".
- Copy the layermask to the clipboard.
- Paste the clipboard to a new layer (above the original).
- Set the layer blend mode of the new layer to Divide.
Owing to GIMP's 8-bit color limitation, there will be roundoff error, but the result would be mathematically correct (and the error would be miniscule when using 32-bit floating point color).
Bear in mind that the PMA image you see in GIMP will never appear the same as a separate alpha image. The tutorial to which you linked was designed to create an image that could be exported to a different program -- GIMP always assumes that a separate alpha color representation is being used (though internally it may use PMA for compositing previews).