diff --git a/coders/xpm.c b/coders/xpm.c
index 1b16ce2..f07adc3 100644
--- a/coders/xpm.c
+++ b/coders/xpm.c
@@ -741,7 +741,7 @@
     pixel.colorspace=RGBColorspace;
     pixel.depth=8;
     pixel.alpha=(MagickRealType) OpaqueAlpha;
-    (void) QueryMagickColorname(image,&pixel,XPMCompliance,name,exception);
+    (void) QueryColorname(image,&pixel,XPMCompliance,name,exception);
     if (transparent != MagickFalse)
       {
         if (i == (ssize_t) (colors-1))
@@ -977,7 +977,7 @@
     pixel.colorspace=RGBColorspace;
     pixel.depth=8;
     pixel.alpha=(MagickRealType) OpaqueAlpha;
-    (void) QueryMagickColorname(image,&pixel,XPMCompliance,name,exception);
+    (void) QueryColorname(image,&pixel,XPMCompliance,name,exception);
     if (i == opacity)
       (void) CopyMagickString(name,"None",MaxTextExtent);
     /*