Page 1 of 1

Mathematics, or Blend what working as expected.

Posted: 2016-11-16T22:30:36-07:00
by anthony
I was just looking through examples and found that the example showing that Blend and Mathematics with the same arguments, producing the same result.... is NOT producing the same result!

Double checked and they are indeed not producing the same result!

I do not know how long this has been the case or which operator is going wrong...

http://www.imagemagick.org/Usage/compose/#mathematics

And scroll down to the example generating a 'Blend' using 'Mathematics' composition.

Re: Mathematics, or Blend what working as expected.

Posted: 2016-11-16T22:35:21-07:00
by anthony
Hmmm.... OKAY... it may be a result of 'colorspace'. Images now using non-linear sRGB, by mathematics being applied without regard to that.

Not certian how to 'fix' the example if that is the case... can't spend that much time on it.

Re: Mathematics, or Blend what working as expected.

Posted: 2016-11-16T23:24:48-07:00
by snibgo
RGB/sRGB isn't the problem, because in your examples you use fully saturated colours, and these have the same values in both colorspaces.

The Blend operation doesn't currently follow the description on your web page, that the colour channels and alpha from the two images are multipled by the percentages and added.

I'm not sure that Blend ever did work like that.

For example, with IM v6.9.5-3, blend_25x75, look at the upper-most red pixels with Gimp or similar. They have values RGBA(100%,0,0,75%).

If they followed your description, the red channel would be: 0.75*100% + 0.25*0% = 75%. (Because the source image compose_plus_GB.png has values RGBA(0,0,0,0) at those pixels.)

Re: Mathematics, or Blend what working as expected.

Posted: 2016-11-16T23:35:45-07:00
by anthony
Yes I see... for pixels that are not overlapping you get the full color with a partial transparency, and not a darker color at partial transparency
In other words the mathematical operator would only apply correctly to overlapping pixels where you have no transparency, just a 'blend' of color.

Stupid.. Example is invalid... removing it.