Page 1 of 1

c++ lib, photoshop layers with opacity are inverted

Posted: 2009-05-05T13:46:48-07:00
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

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

Posted: 2009-05-05T13:59:46-07:00
by magick
To investigate we need a URL to a problematic PSD image and a description of which layer(s) you feel are inverted.

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

Posted: 2009-05-05T16:42:52-07:00
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.