diff --git a/coders/dpx.c b/coders/dpx.c
index f8ab206..e2e417e 100644
--- a/coders/dpx.c
+++ b/coders/dpx.c
@@ -57,6 +57,7 @@
 #include "MagickCore/monitor.h"
 #include "MagickCore/monitor-private.h"
 #include "MagickCore/option.h"
+#include "MagickCore/pixel-accessor.h"
 #include "MagickCore/profile.h"
 #include "MagickCore/property.h"
 #include "MagickCore/quantum-private.h"
@@ -1809,8 +1810,7 @@
     }
   extent=GetBytesPerRow(image->columns,image->matte != MagickFalse ? 4UL : 3UL,
     image->depth,MagickTrue);
-  if ((image_info->type != UndefinedType) &&
-      (image_info->type != TrueColorType) && (image->matte == MagickFalse) &&
+  if ((image_info->type != TrueColorType) && (image->matte == MagickFalse) &&
       (IsImageGray(image,exception) != MagickFalse))
     {
       quantum_type=GrayQuantum;