region.y=y;
region.width=columns;
region.height=rows;
- pixels=SetPixelCacheNexusPixels(cache_info,ReadMode,®ion,image->write_mask,
+ pixels=SetPixelCacheNexusPixels(cache_info,ReadMode,®ion,
+ image->write_mask || image->composite_mask ? MagickTrue : MagickFalse,
nexus_info,exception);
if (pixels == (Quantum *) NULL)
return((const Quantum *) NULL);
double
mask_alpha;
- if (alpha == TransparentAlpha)
- return(q);
+ if (fabs(alpha-OpaqueAlpha) < MagickEpsilon)
+ return(p);
mask_alpha=1.0-QuantumScale*QuantumScale*alpha*beta;
mask_alpha=PerceptibleReciprocal(mask_alpha);
return(mask_alpha*MagickOver_(p,alpha,q,beta));
PixelTrait traits = GetPixelChannelTraits(image,channel);
if ((traits & UpdatePixelTrait) == 0)
continue;
- q[i]=ApplyPixelCompositeMask(q[i],mask_alpha,p[i],GetPixelAlpha(image,p));
+ q[i]=ApplyPixelCompositeMask(p[i],mask_alpha,q[i],GetPixelAlpha(image,q));
}
p+=GetPixelChannels(image);
q+=GetPixelChannels(image);
region.width=columns;
region.height=rows;
pixels=SetPixelCacheNexusPixels(cache_info,WriteMode,®ion,
- image->write_mask,nexus_info,exception);
+ image->write_mask || image->composite_mask ? MagickTrue : MagickFalse,
+ nexus_info,exception);
return(pixels);
}
\f