Page 1 of 1

Working with alpha turns color pixels black outside of mask

Posted: 2009-01-20T05:11:48-07:00
by KingFish
Hi.
I have an image with an alpha channel defining the mask.
Using
convert.exe file.psd -alpha on file.tga
will create a tga file that has the correct alpha mask set, but has the color values outside of the mask turned to black.
Is there any way to avoid this?

Re: Working with alpha turns color pixels black outside of mask

Posted: 2009-01-20T23:23:32-07:00
by anthony
Depends on how the mask was defined in the PSD file.

PSD files can be a real pain to use as they are not a 'typical' image format, but an image editing format.

Re: Working with alpha turns color pixels black outside of mask

Posted: 2009-01-22T02:58:19-07:00
by KingFish
Well, the source data is pretty simple.
If I save the file without alpha (convert file.psd -alpha off file.tga) it correctly shows all color.
If I extract the mask (convert file.psd -alpha extract file_mask.tga) it also is correct (8-bit, black where the color should not be visible and white where it should be).
I'm a bit clueless. Sadly, if this is the default behavior of ImageMagick and there is no way to change it I have to switch to another program.

Re: Working with alpha turns color pixels black outside of mask

Posted: 2009-01-22T03:48:44-07:00
by anthony
Are you sure a TGA format can handle a transparency?

Try generating an image with transparency and saving it to TGA and checking the result.

Re: Working with alpha turns color pixels black outside of mask

Posted: 2009-01-30T05:45:37-07:00
by KingFish
Hi.
I now checked it with various file formats and all show the same behavior. Meaning in the output file all pixels of the colormap that are outside of the alpha mask are turned to black when using -alpha on.

Re: Working with alpha turns color pixels black outside of mask

Posted: 2009-02-01T21:18:25-07:00
by anthony
Can you provide us with a link to such a image (preferably PNG and not PSD), and the command that shows the transparent pixels turning black.