diff --git a/coders/jp2.c b/coders/jp2.c
index 7cb48ae..9c63098 100644
--- a/coders/jp2.c
+++ b/coders/jp2.c
@@ -929,11 +929,11 @@
       else
         {
           jas_matrix_setv(pixels[0],x,(jas_seqent_t)
-            ScaleQuantumToAny(p->red,range));
+            ScaleQuantumToAny(GetRedPixelComponent(p),range));
           jas_matrix_setv(pixels[1],x,(jas_seqent_t)
-            ScaleQuantumToAny(p->green,range));
+            ScaleQuantumToAny(GetGreenPixelComponent(p),range));
           jas_matrix_setv(pixels[2],x,(jas_seqent_t)
-            ScaleQuantumToAny(p->blue,range));
+            ScaleQuantumToAny(GetBluePixelComponent(p),range));
           if (number_components > 3)
             jas_matrix_setv(pixels[3],x,(jas_seqent_t)
               ScaleQuantumToAny((Quantum) (GetAlphaPixelComponent(p)),range));
diff --git a/coders/pnm.c b/coders/pnm.c
index 421846b..6a0290f 100644
--- a/coders/pnm.c
+++ b/coders/pnm.c
@@ -1889,7 +1889,7 @@
                       if (image->depth == 8)
                         pixel=ScaleQuantumToChar(GetRedPixelComponent(p));
                       else
-                        pixel=ScaleQuantumToAny(p->red,range);
+                        pixel=ScaleQuantumToAny(GetRedPixelComponent(p),range);
                     }
                   q=PopCharPixel((unsigned char) pixel,q);
                   p++;
@@ -1904,7 +1904,7 @@
                       if (image->depth == 16)
                         pixel=ScaleQuantumToShort(GetRedPixelComponent(p));
                       else
-                        pixel=ScaleQuantumToAny(p->red,range);
+                        pixel=ScaleQuantumToAny(GetRedPixelComponent(p),range);
                     }
                   q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
                   p++;
@@ -1964,22 +1964,22 @@
               if (image->depth <= 8)
                 for (x=0; x < (ssize_t) image->columns; x++)
                 {
-                  pixel=ScaleQuantumToAny(p->red,range);
+                  pixel=ScaleQuantumToAny(GetRedPixelComponent(p),range);
                   q=PopCharPixel((unsigned char) pixel,q);
-                  pixel=ScaleQuantumToAny(p->green,range);
+                  pixel=ScaleQuantumToAny(GetGreenPixelComponent(p),range);
                   q=PopCharPixel((unsigned char) pixel,q);
-                  pixel=ScaleQuantumToAny(p->blue,range);
+                  pixel=ScaleQuantumToAny(GetBluePixelComponent(p),range);
                   q=PopCharPixel((unsigned char) pixel,q);
                   p++;
                 }
               else
                 for (x=0; x < (ssize_t) image->columns; x++)
                 {
-                  pixel=ScaleQuantumToAny(p->red,range);
+                  pixel=ScaleQuantumToAny(GetRedPixelComponent(p),range);
                   q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
-                  pixel=ScaleQuantumToAny(p->green,range);
+                  pixel=ScaleQuantumToAny(GetGreenPixelComponent(p),range);
                   q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
-                  pixel=ScaleQuantumToAny(p->blue,range);
+                  pixel=ScaleQuantumToAny(GetBluePixelComponent(p),range);
                   q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
                   p++;
                 }
@@ -2045,7 +2045,7 @@
                       q=PopCharPixel((unsigned char) pixel,q);
                       if (image->matte != MagickFalse)
                         {
-                          pixel=(unsigned char) ScaleQuantumToAny(p->opacity,
+                          pixel=(unsigned char) ScaleQuantumToAny(GetOpacityPixelComponent(p),
                             range);
                           q=PopCharPixel((unsigned char) pixel,q);
                         }
@@ -2058,7 +2058,7 @@
                       q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
                       if (image->matte != MagickFalse)
                         {
-                          pixel=(unsigned char) ScaleQuantumToAny(p->opacity,
+                          pixel=(unsigned char) ScaleQuantumToAny(GetOpacityPixelComponent(p),
                             range);
                           q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
                         }
@@ -2072,13 +2072,13 @@
                   if (image->depth <= 8)
                     for (x=0; x < (ssize_t) image->columns; x++)
                     {
-                      pixel=ScaleQuantumToAny(p->red,range);
+                      pixel=ScaleQuantumToAny(GetRedPixelComponent(p),range);
                       q=PopCharPixel((unsigned char) pixel,q);
-                      pixel=ScaleQuantumToAny(p->green,range);
+                      pixel=ScaleQuantumToAny(GetGreenPixelComponent(p),range);
                       q=PopCharPixel((unsigned char) pixel,q);
-                      pixel=ScaleQuantumToAny(p->blue,range);
+                      pixel=ScaleQuantumToAny(GetBluePixelComponent(p),range);
                       q=PopCharPixel((unsigned char) pixel,q);
-                      pixel=ScaleQuantumToAny(indexes[x],range);
+                      pixel=ScaleQuantumToAny(GetIndexPixelComponent(indexes+x),range);
                       q=PopCharPixel((unsigned char) pixel,q);
                       if (image->matte != MagickFalse)
                         {
@@ -2091,13 +2091,13 @@
                   else
                     for (x=0; x < (ssize_t) image->columns; x++)
                     {
-                      pixel=ScaleQuantumToAny(p->red,range);
+                      pixel=ScaleQuantumToAny(GetRedPixelComponent(p),range);
                       q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
-                      pixel=ScaleQuantumToAny(p->green,range);
+                      pixel=ScaleQuantumToAny(GetGreenPixelComponent(p),range);
                       q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
-                      pixel=ScaleQuantumToAny(p->blue,range);
+                      pixel=ScaleQuantumToAny(GetBluePixelComponent(p),range);
                       q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
-                      pixel=ScaleQuantumToAny(indexes[x],range);
+                      pixel=ScaleQuantumToAny(GetIndexPixelComponent(indexes+x),range);
                       q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
                       if (image->matte != MagickFalse)
                         {
@@ -2114,11 +2114,11 @@
                   if (image->depth <= 8)
                     for (x=0; x < (ssize_t) image->columns; x++)
                     {
-                      pixel=ScaleQuantumToAny(p->red,range);
+                      pixel=ScaleQuantumToAny(GetRedPixelComponent(p),range);
                       q=PopCharPixel((unsigned char) pixel,q);
-                      pixel=ScaleQuantumToAny(p->green,range);
+                      pixel=ScaleQuantumToAny(GetGreenPixelComponent(p),range);
                       q=PopCharPixel((unsigned char) pixel,q);
-                      pixel=ScaleQuantumToAny(p->blue,range);
+                      pixel=ScaleQuantumToAny(GetBluePixelComponent(p),range);
                       q=PopCharPixel((unsigned char) pixel,q);
                       if (image->matte != MagickFalse)
                         {
@@ -2131,11 +2131,11 @@
                   else
                     for (x=0; x < (ssize_t) image->columns; x++)
                     {
-                      pixel=ScaleQuantumToAny(p->red,range);
+                      pixel=ScaleQuantumToAny(GetRedPixelComponent(p),range);
                       q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
-                      pixel=ScaleQuantumToAny(p->green,range);
+                      pixel=ScaleQuantumToAny(GetGreenPixelComponent(p),range);
                       q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
-                      pixel=ScaleQuantumToAny(p->blue,range);
+                      pixel=ScaleQuantumToAny(GetBluePixelComponent(p),range);
                       q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
                       if (image->matte != MagickFalse)
                         {