c++ lib, photoshop layers with opacity are inverted

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jigidyjim

c++ lib, photoshop layers with opacity are inverted

Post by jigidyjim »

Hello,

Using a std::vector<Image> and readImages(), I'm reading in a .psd file.

If I then iterate through that file and write each layer out to a separate file, I'm finding that some of my images have the alpha channel inverted.

Looking at it, it's any layer that has an opacity set to something less than 100% that has this issue.

So I thought in code I'd just flip the opacity again, but I'm finding that images.attribute("layer-opacity") always returns an empty string. images.attribute("label") correctly returns the layer name though...


Any ideas on what I can do?

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

Re: c++ lib, photoshop layers with opacity are inverted

Post by magick »

To investigate we need a URL to a problematic PSD image and a description of which layer(s) you feel are inverted.
jigidyjim

Re: c++ lib, photoshop layers with opacity are inverted

Post by jigidyjim »

I'll look for a place to post files.

In the meantime, creating one is easy:

1) Create photoshop file
2) Paint the background layer with the bucket
3) create a new layer
4) Paint some stuff with the paint brush (be sure to leave some alpha on the layer).
5) Save

then run it through image magick as i described. the 2nd layer will come out correctly.

6) Change the opacity on your 2nd layer to 50%
7) Save

Then run it through image magick as I described. The 2nd layer will not come out correclty - areas that should be solid (or 50% opacity, depending on your interpretation), will now be completely clear.

Thanks.
Post Reply