bug in photoshop opacity layers?

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
jigidyjim

bug in photoshop opacity layers?

Post by jigidyjim »

I think I've tracked down a bug in the way photoshop opacity layers are parsed.

There's been a discussion going on here:

viewtopic.php?f=1&t=15351

I think the issue is either the math to apply opacity layers has an inverted 0->QuantumRange setting, or it is overflowing incorrectly.

I'm still working out how to fix the issue, but will post my findings soon...
jigidyjim

Re: bug in photoshop opacity layers?

Post by jigidyjim »

Ok - here is my work around code, and I get the right results. I'm not 100% sure this is the correct fix since I don't understand the code all that well... hopefully this helps!

Previous line to take into account layer opacity:

q->opacity=(Quantum) (QuantumRange-(Quantum)
(QuantumScale*(q->opacity*layer_info.opacity)));


Changed line to take into account layer opacity:

q->opacity=(Quantum) (QuantumRange-(Quantum)
(QuantumScale*((QuantumRange-q->opacity)*(QuantumRange-layer_info.opacity))));


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

Re: bug in photoshop opacity layers?

Post by magick »

We will get your patch into the next point release of ImageMagick. Thanks.
Post Reply