diff --git a/coders/pcx.c b/coders/pcx.c
index f688128..b7d5e80 100644
--- a/coders/pcx.c
+++ b/coders/pcx.c
@@ -1089,9 +1089,6 @@
           }
         else
           {
-            Quantum
-              polarity;
-
             register unsigned char
               bit,
               byte;
@@ -1099,11 +1096,6 @@
             /*
               Convert PseudoClass image to a PCX monochrome image.
             */
-            polarity=(Quantum) (GetPixelInfoIntensity(
-              &image->colormap[0]) < (QuantumRange/2) ? 1 : 0);
-            if (image->colors == 2)
-              polarity=(Quantum) (GetPixelInfoIntensity(&image->colormap[0]) <
-                GetPixelInfoIntensity(&image->colormap[1]) ? 1 : 0);
             for (y=0; y < (ssize_t) image->rows; y++)
             {
               p=GetVirtualPixels(image,0,y,image->columns,1,exception);
@@ -1115,7 +1107,7 @@
               for (x=0; x < (ssize_t) image->columns; x++)
               {
                 byte<<=1;
-                if (GetPixelIndex(image,p) == polarity)
+                if (GetPixelLuma(image,p) >= (QuantumRange/2.0))
                   byte|=0x01;
                 bit++;
                 if (bit == 8)
diff --git a/tests/validate.h b/tests/validate.h
index 2d67837..890d718 100644
--- a/tests/validate.h
+++ b/tests/validate.h
@@ -102,6 +102,7 @@
     "-black-threshold 20%",
     "-blur 0x0.5",
     "-border 6x6",
+    "-canny 0x1+10%+80%",
     "-charcoal 0x1",
     "-chop 8x6+20+30",
     "-colors 16",