?flattenImages & opacity

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
igorvlassov

?flattenImages & opacity

Post by igorvlassov »

When I use STL ImageMagic++ func flattenImages under a list of PSD layers the result image lost opacity. Do you know the way to keep opacity or inherit it from the first layer?

Thanks
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ?flattenImages & opacity

Post by magick »

The flatten-image algorithm starts with an image canvas set to the image background color. Try setting the image background color to "none" which means completely transparent.
igorvlassov

Re: ?flattenImages & opacity

Post by igorvlassov »

I tried to use
image.backgroundColor(Color(0,0,0,QuantumRange));
flattenImages(&image, lstImages.begin(), lstImages.end());

but opacity didn't appear.
seanburke1979

Re: ?flattenImages & opacity

Post by seanburke1979 »

"Color(0,0,0,QuantumRange)" is black, isn't it? Try image.backgroundColor(Color(0,0,0,1.0)). I haven't tried that, but the doumentation says that alpha is scaled 0->1.0 (opaque to transparent).

Sean
Post Reply