]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/composite.c
Update web pages
[imagemagick] / MagickCore / composite.c
index 14cd5a41fcd01a2b2c31dcf01283cf3d0aa16882..b183da6e97943dcec13eda6fbb88bf35ef13e612 100644 (file)
@@ -2074,7 +2074,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
                Dca' = A*Sca*Dca + B*Sca*Da + C*Dca*Sa + D*Sa*Da + Sca*(1.0-Da) +
                  Dca*(1.0-Sa)
             */
-            pixel=gamma*(geometry_info.rho*Sca*Dca+
+            pixel=QuantumRange*gamma*(geometry_info.rho*Sca*Dca+
               geometry_info.sigma*Sca*Da+geometry_info.xi*Dca*Sa+
               geometry_info.psi*Sa*Da+Sca*(1.0-Da)+Dca*(1.0-Sa));
             break;
@@ -2127,15 +2127,19 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
           case ModulusAddCompositeOp:
           {
             pixel=Sc+Dc;
-            if (pixel > QuantumRange)
+            while (pixel > QuantumRange)
               pixel-=QuantumRange;
+            while (pixel < 0.0)
+              pixel+=QuantumRange;
             pixel=(Sa*Da*pixel+Sa*Sc*(1.0-Da)+Da*Dc*(1.0-Sa));
             break;
           }
           case ModulusSubtractCompositeOp:
           {
             pixel=Sc-Dc;
-            if (pixel < 0.0)
+            while (pixel > QuantumRange)
+              pixel-=QuantumRange;
+            while (pixel < 0.0)
               pixel+=QuantumRange;
             pixel=(Sa*Da*pixel+Sa*Sc*(1.0-Da)+Da*Dc*(1.0-Sa));
             break;
@@ -2430,7 +2434,7 @@ MagickExport MagickBooleanType TextureImage(Image *image,const Image *texture,
             thread_status;
 
           thread_status=CompositeImage(image,texture_image,image->compose,
-            MagickFalse,x+texture_image->tile_offset.x,y+
+            MagickTrue,x+texture_image->tile_offset.x,y+
             texture_image->tile_offset.y,exception);
           if (thread_status == MagickFalse)
             {