Page 1 of 1

bug in photoshop opacity layers?

Posted: 2010-01-15T11:34:51-07:00
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...

Re: bug in photoshop opacity layers?

Posted: 2010-01-15T13:17:04-07:00
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!

Re: bug in photoshop opacity layers?

Posted: 2010-01-15T13:25:32-07:00
by magick
We will get your patch into the next point release of ImageMagick. Thanks.