diff --git a/MagickCore/composite-private.h b/MagickCore/composite-private.h
index 745c617..e2efff0 100644
--- a/MagickCore/composite-private.h
+++ b/MagickCore/composite-private.h
@@ -55,7 +55,7 @@
   /*
     Compose pixel p over pixel q with the given opacities.
   */
-  if (alpha == TransparentAlpha)
+  if (fabs(alpha-TransparentAlpha) < MagickEpsilon)
     {
       if (composite != q)
         {
@@ -102,7 +102,7 @@
   /*
     Compose pixel p over pixel q with the given opacities.
   */
-  if (alpha == OpaqueAlpha)
+  if (fabs(alpha-OpaqueAlpha) < MagickEpsilon)
     {
       *composite=(*p);
       return;