On Mon, 2007-02-12 at 23:50 -0800, "Germain Le Chapelain"
> I would like to know who to copy the alpha channel of an image to
> another image.

1. Merge visible layers of the source image.
2. Copy visible layer of source image
3. Create new image for destination (as in File->New).
4. Add a layer to destination image
5. Delete background layer in destination image
6. Add black layer mask to only layer left in destination image.
7. Make black layer mask active drawable.
8. Paste into destination image.
9. Anchor to active drawable (re: mask).
10. Apply layer mask.

Now the destination image (at least in that one layer) has the same
alpha as your source image.

Steps 4-5 could be:

4. Add alpha channel to background layer
5. (delete this step)

Should also work in both 2.2 and 2.4.

I tried this with a simple white image (single layer) using a gradient
in a layer mask to create the source image.  I then applied the layer
mask in the source image to put the alpha into the layer itself.  When
this layer was copied to the black layer mask of the destination, the
visual appearance was correct.  When I saved both files (after applying
the mask in the destination) they have the same file size (as expected)
but they are not binary identical when saved as either XCF, TIFF or PNG.
Not sure why (maybe some metadata differences?).  I did notice that the
pasted copy had a selection outline that was not the full size of the
source image (both images where the same size).  So even though I did a
Select->All, Edit->Copy (I also tried Edit->Copy Visible), it appears to
only have picked up to a certain transparency level in the copy.  Or
maybe it's just that the marching ants only recognize up to a certain
level when pasted.

Maybe one of the developers has some insight as to why the source and
destination wouldn't be identical in this case.  
Michael J. Hammel                                    Senior Software Engineer
[EMAIL PROTECTED]                           http://graphics-muse.org
Success is never hard won.  It is hard achieved.  --  Michael J. Hammel

Gimp-user mailing list

Reply via email to