]> granicus.if.org Git - imagemagick/commitdiff
Fixed OverlayCompositeOp calculation.
authordirk <dirk@git.imagemagick.org>
Mon, 14 Dec 2015 22:37:38 +0000 (23:37 +0100)
committerdirk <dirk@git.imagemagick.org>
Mon, 14 Dec 2015 22:37:38 +0000 (23:37 +0100)
MagickCore/composite.c

index 588d786ea4bab73153740decdf1b41319fea7f05..c04976db18dd04cd2568d087db8c4e8d14e5bbfe 100644 (file)
@@ -2132,13 +2132,14 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
           }
           case OverlayCompositeOp:
           {
-            if ((2.0*Dca) <= Da)
+            if ((2.0*Dca) < Da)
               {
-                pixel=QuantumRange*(2.0*Sca*Dca+Sca*(1.0-Da)+Dca*(1.0-Sa));
+                pixel=QuantumRange*gamma*(2.0*Dca*Sca+Dca*(1.0-Sa)+Sca*(1.0-
+                  Da));
                 break;
               }
-            pixel=QuantumRange*(Sa*Da-2.0*(Da-Dca)*(Sa-Sca)+Sca*(1.0-Da)+Dca*
-              (1.0-Sa));
+            pixel=QuantumRange*gamma*(Da*Sa-2.0*(Sa-Sca)*(Da-Dca)+Dca*(1.0-Sa)+
+              Sca*(1.0-Da));
             break;
           }
           case PegtopLightCompositeOp: