]> granicus.if.org Git - imagemagick/blobdiff - magick/color.c
(no commit message)
[imagemagick] / magick / color.c
index bc489271baed442f545a8d5a58428ffac5b63fbb..28378d6d8b4f7ef0529705f85a80a87b322ddb7a 100644 (file)
@@ -85,7 +85,7 @@ typedef struct _ColorMapInfo
     blue,
     alpha;
 
-  const long
+  const ssize_t
     compliance;
 } ColorMapInfo;
 \f
@@ -95,7 +95,7 @@ typedef struct _ColorMapInfo
 static const ColorMapInfo
   ColorMap[] =
   {
-    { "none", 0, 0, 0, 0, SVGCompliance },
+    { "none", 0, 0, 0, 0, SVGCompliance | XPMCompliance },
     { "black", 0, 0, 0, 1, SVGCompliance | X11Compliance | XPMCompliance },
     { "red", 255, 0, 0, 1, SVGCompliance | X11Compliance | XPMCompliance },
     { "magenta", 255, 0, 255, 1, SVGCompliance | X11Compliance | XPMCompliance },
@@ -873,32 +873,31 @@ MagickExport void ColorComponentTerminus(void)
 %                                                                             %
 %                                                                             %
 %                                                                             %
-+   G e t C o l o r I n f o                                                   %
++   G e t C o l o r C o m p l i a n c e                                       %
 %                                                                             %
 %                                                                             %
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  GetColorInfo() searches the color list for the specified name and if found
-%  returns attributes for that color.
+%  GetColorInfo() searches the color list for the specified name and standards
+%  compliance and if found returns attributes for that color.
 %
 %  The format of the GetColorInfo method is:
 %
 %      const PixelPacket *GetColorInfo(const char *name,
-%        ExceptionInfo *exception)
+%        const ComplianceType compliance,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
-%    o color_info: search the color list for the specified name and if found
-%      return attributes for that color.
-%
 %    o name: the color name.
 %
+%    o compliance: Adhere to this color standard: SVG, X11, or XPM.
+%
 %    o exception: return any errors or warnings in this structure.
 %
 */
-MagickExport const ColorInfo *GetColorInfo(const char *name,
-  ExceptionInfo *exception)
+MagickExport const ColorInfo *GetColorCompliance(const char *name,
+  const ComplianceType compliance,ExceptionInfo *exception)
 {
   char
     colorname[MaxTextExtent];
@@ -938,7 +937,8 @@ MagickExport const ColorInfo *GetColorInfo(const char *name,
   p=(const ColorInfo *) GetNextValueInLinkedList(color_list);
   while (p != (const ColorInfo *) NULL)
   {
-    if (LocaleCompare(colorname,p->name) == 0)
+    if (((p->compliance & compliance) != 0) &&
+        (LocaleCompare(colorname,p->name) == 0))
       break;
     p=(const ColorInfo *) GetNextValueInLinkedList(color_list);
   }
@@ -957,6 +957,41 @@ MagickExport const ColorInfo *GetColorInfo(const char *name,
 %                                                                             %
 %                                                                             %
 %                                                                             %
++   G e t C o l o r I n f o                                                   %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  GetColorInfo() searches the color list for the specified name and if found
+%  returns attributes for that color.
+%
+%  The format of the GetColorInfo method is:
+%
+%      const PixelPacket *GetColorInfo(const char *name,
+%        ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o color_info: search the color list for the specified name and if found
+%      return attributes for that color.
+%
+%    o name: the color name.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport const ColorInfo *GetColorInfo(const char *name,
+  ExceptionInfo *exception)
+{
+  return(GetColorCompliance(name,AllCompliance,exception));
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 +   C o n c a t e n a t e C o l o r C o m p o n e n t                         %
 %                                                                             %
 %                                                                             %
@@ -1085,7 +1120,7 @@ MagickExport void ConcatenateColorComponent(const MagickPixelPacket *pixel,
 %  The format of the GetColorInfoList function is:
 %
 %      const ColorInfo **GetColorInfoList(const char *pattern,
-%        unsigned long *number_colors,ExceptionInfo *exception)
+%        size_t *number_colors,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -1119,7 +1154,7 @@ static int ColorInfoCompare(const void *x,const void *y)
 #endif
 
 MagickExport const ColorInfo **GetColorInfoList(const char *pattern,
-  unsigned long *number_colors,ExceptionInfo *exception)
+  size_t *number_colors,ExceptionInfo *exception)
 {
   const ColorInfo
     **colors;
@@ -1127,7 +1162,7 @@ MagickExport const ColorInfo **GetColorInfoList(const char *pattern,
   register const ColorInfo
     *p;
 
-  register long
+  register ssize_t
     i;
 
   /*
@@ -1135,7 +1170,7 @@ MagickExport const ColorInfo **GetColorInfoList(const char *pattern,
   */
   assert(pattern != (char *) NULL);
   (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
-  assert(number_colors != (unsigned long *) NULL);
+  assert(number_colors != (size_t *) NULL);
   *number_colors=0;
   p=GetColorInfo("*",exception);
   if (p == (const ColorInfo *) NULL)
@@ -1160,7 +1195,7 @@ MagickExport const ColorInfo **GetColorInfoList(const char *pattern,
   UnlockSemaphoreInfo(color_semaphore);
   qsort((void *) colors,(size_t) i,sizeof(*colors),ColorInfoCompare);
   colors[i]=(ColorInfo *) NULL;
-  *number_colors=(unsigned long) i;
+  *number_colors=(size_t) i;
   return(colors);
 }
 \f
@@ -1179,7 +1214,7 @@ MagickExport const ColorInfo **GetColorInfoList(const char *pattern,
 %
 %  The format of the GetColorList function is:
 %
-%      char **GetColorList(const char *pattern,unsigned long *number_colors,
+%      char **GetColorList(const char *pattern,size_t *number_colors,
 %        ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
@@ -1212,7 +1247,7 @@ static int ColorCompare(const void *x,const void *y)
 #endif
 
 MagickExport char **GetColorList(const char *pattern,
-  unsigned long *number_colors,ExceptionInfo *exception)
+  size_t *number_colors,ExceptionInfo *exception)
 {
   char
     **colors;
@@ -1220,7 +1255,7 @@ MagickExport char **GetColorList(const char *pattern,
   register const ColorInfo
     *p;
 
-  register long
+  register ssize_t
     i;
 
   /*
@@ -1228,7 +1263,7 @@ MagickExport char **GetColorList(const char *pattern,
   */
   assert(pattern != (char *) NULL);
   (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
-  assert(number_colors != (unsigned long *) NULL);
+  assert(number_colors != (size_t *) NULL);
   *number_colors=0;
   p=GetColorInfo("*",exception);
   if (p == (const ColorInfo *) NULL)
@@ -1253,7 +1288,7 @@ MagickExport char **GetColorList(const char *pattern,
   UnlockSemaphoreInfo(color_semaphore);
   qsort((void *) colors,(size_t) i,sizeof(*colors),ColorCompare);
   colors[i]=(char *) NULL;
-  *number_colors=(unsigned long) i;
+  *number_colors=(size_t) i;
   return(colors);
 }
 \f
@@ -1329,7 +1364,7 @@ static void ConcatentateHexColorComponent(const MagickPixelPacket *pixel,
   if (pixel->depth > 32)
     {
       (void) FormatMagickString(component,MaxTextExtent,"%08lX",
-        ScaleQuantumToLong(ClampToQuantum(color)));
+        (unsigned long) ScaleQuantumToLong(ClampToQuantum(color)));
       (void) ConcatenateMagickString(tuple,component,MaxTextExtent);
       return;
     }
@@ -1404,7 +1439,7 @@ MagickExport void GetColorTuple(const MagickPixelPacket *pixel,
         color.depth=8;
     }
   (void) ConcatenateMagickString(tuple,MagickOptionToMnemonic(
-    MagickColorspaceOptions,(long) color.colorspace),MaxTextExtent);
+    MagickColorspaceOptions,(ssize_t) color.colorspace),MaxTextExtent);
   if (color.matte != MagickFalse)
     (void) ConcatenateMagickString(tuple,"a",MaxTextExtent);
   (void) ConcatenateMagickString(tuple,"(",MaxTextExtent);
@@ -1562,7 +1597,7 @@ MagickExport MagickBooleanType IsColorSimilar(const Image *image,
 %  The format of the IsImageSimilar method is:
 %
 %      MagickBooleanType IsImageSimilar(const Image *image,
-%        const Image *target_image,long *x_offset,long *y_offset,
+%        const Image *target_image,ssize_t *x_offset,ssize_t *y_offset,
 %        ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
@@ -1581,7 +1616,7 @@ MagickExport MagickBooleanType IsColorSimilar(const Image *image,
 %
 */
 MagickExport MagickBooleanType IsImageSimilar(const Image *image,
-  const Image *target_image,long *x_offset,long *y_offset,
+  const Image *target_image,ssize_t *x_offset,ssize_t *y_offset,
   ExceptionInfo *exception)
 {
 #define SearchImageText  "  Searching image...  "
@@ -1590,7 +1625,7 @@ MagickExport MagickBooleanType IsImageSimilar(const Image *image,
     *image_view,
     *target_view;
 
-  long
+  ssize_t
     j,
     y;
 
@@ -1609,7 +1644,7 @@ MagickExport MagickBooleanType IsImageSimilar(const Image *image,
     *indexes,
     *target_indexes;
 
-  register long
+  register ssize_t
     i,
     x;
 
@@ -1619,21 +1654,21 @@ MagickExport MagickBooleanType IsImageSimilar(const Image *image,
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   assert(target_image != (Image *) NULL);
   assert(target_image->signature == MagickSignature);
-  assert(x_offset != (long *) NULL);
-  assert(y_offset != (long *) NULL);
+  assert(x_offset != (ssize_t *) NULL);
+  assert(y_offset != (ssize_t *) NULL);
   assert(exception != (ExceptionInfo *) NULL);
   x=0;
   GetMagickPixelPacket(image,&pixel);
   GetMagickPixelPacket(image,&target);
   image_view=AcquireCacheView(image);
   target_view=AcquireCacheView(target_image);
-  for (y=(*y_offset); y < (long) image->rows; y++)
+  for (y=(*y_offset); y < (ssize_t) image->rows; y++)
   {
-    for (x=y == 0 ? *x_offset : 0; x < (long) image->columns; x++)
+    for (x=y == 0 ? *x_offset : 0; x < (ssize_t) image->columns; x++)
     {
-      for (j=0; j < (long) target_image->rows; j++)
+      for (j=0; j < (ssize_t) target_image->rows; j++)
       {
-        for (i=0; i < (long) target_image->columns; i++)
+        for (i=0; i < (ssize_t) target_image->columns; i++)
         {
           p=GetCacheViewVirtualPixels(image_view,x+i,y+j,1,1,exception);
           indexes=GetCacheViewVirtualIndexQueue(image_view);
@@ -1644,28 +1679,30 @@ MagickExport MagickBooleanType IsImageSimilar(const Image *image,
           if (IsMagickColorSimilar(&pixel,&target) == MagickFalse)
             break;
         }
-        if (i < (long) target_image->columns)
+        if (i < (ssize_t) target_image->columns)
           break;
       }
-      if (j == (long) target_image->rows)
+      if (j == (ssize_t) target_image->rows)
         break;
     }
-    if (x < (long) image->columns)
+    if (x < (ssize_t) image->columns)
       break;
-    if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
-        (QuantumTick(y,image->rows) != MagickFalse))
+    if (image->progress_monitor != (MagickProgressMonitor) NULL)
       {
-        status=image->progress_monitor(SearchImageText,y,image->rows,
-          image->client_data);
-        if (status == MagickFalse)
-          break;
+        MagickBooleanType
+          proceed;
+
+        proceed=SetImageProgress(image,SearchImageText,(MagickOffsetType) y,
+          image->rows);
+        if (proceed == MagickFalse)
+          status=MagickFalse;
       }
   }
   target_view=DestroyCacheView(target_view);
   image_view=DestroyCacheView(image_view);
   *x_offset=x;
   *y_offset=y;
-  return(y < (long) image->rows ? MagickTrue : MagickFalse);
+  return(y < (ssize_t) image->rows ? MagickTrue : MagickFalse);
 }
 \f
 /*
@@ -1849,10 +1886,10 @@ MagickExport MagickBooleanType ListColorInfo(FILE *file,
   const ColorInfo
     **color_info;
 
-  register long
+  register ssize_t
     i;
 
-  unsigned long
+  size_t
     number_colors;
 
   /*
@@ -1864,7 +1901,7 @@ MagickExport MagickBooleanType ListColorInfo(FILE *file,
   if (color_info == (const ColorInfo **) NULL)
     return(MagickFalse);
   path=(const char *) NULL;
-  for (i=0; i < (long) number_colors; i++)
+  for (i=0; i < (ssize_t) number_colors; i++)
   {
     if (color_info[i]->stealth != MagickFalse)
       continue;
@@ -1912,7 +1949,7 @@ MagickExport MagickBooleanType ListColorInfo(FILE *file,
 %  The format of the LoadColorList method is:
 %
 %      MagickBooleanType LoadColorList(const char *xml,const char *filename,
-%        const unsigned long depth,ExceptionInfo *exception)
+%        const size_t depth,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -1926,7 +1963,7 @@ MagickExport MagickBooleanType ListColorInfo(FILE *file,
 %
 */
 static MagickBooleanType LoadColorList(const char *xml,const char *filename,
-  const unsigned long depth,ExceptionInfo *exception)
+  const size_t depth,ExceptionInfo *exception)
 {
   char
     keyword[MaxTextExtent],
@@ -2072,7 +2109,7 @@ static MagickBooleanType LoadColorList(const char *xml,const char *filename,
           }
         if (LocaleCompare((char *) keyword,"compliance") == 0)
           {
-            long
+            ssize_t
               compliance;
 
             compliance=color_info->compliance;
@@ -2156,7 +2193,7 @@ static MagickBooleanType LoadColorLists(const char *filename,
   MagickStatusType
     status;
 
-  register long
+  register ssize_t
     i;
 
   /*
@@ -2174,7 +2211,7 @@ static MagickBooleanType LoadColorLists(const char *filename,
         }
     }
   scale=(MagickRealType) ScaleCharToQuantum(1);
-  for (i=0; i < (long) (sizeof(ColorMap)/sizeof(*ColorMap)); i++)
+  for (i=0; i < (ssize_t) (sizeof(ColorMap)/sizeof(*ColorMap)); i++)
   {
     ColorInfo
       *color_info;
@@ -2238,13 +2275,16 @@ static MagickBooleanType LoadColorLists(const char *filename,
 %
 %  The format of the QueryColorDatabase method is:
 %
-%      MagickBooleanType QueryColorDatabase(const char *name,PixelPacket *color,
+%      MagickBooleanType QueryColorDatabase(const char *name,
+%        const ComplianceType compliance,PixelPacket *color,
 %        ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
 %    o name: the color name (e.g. white, blue, yellow).
 %
+%    o compliance: Adhere to this color standard: SVG, X11, or XPM.
+%
 %    o color: the red, green, blue, and opacity intensities values of the
 %      named color in this structure.
 %
@@ -2259,8 +2299,8 @@ static inline double MagickMin(const double x,const double y)
   return(y);
 }
 
-MagickExport MagickBooleanType QueryColorDatabase(const char *name,
-  PixelPacket *color,ExceptionInfo *exception)
+MagickExport MagickBooleanType QueryColorCompliance(const char *name,
+  const ComplianceType compliance,PixelPacket *color,ExceptionInfo *exception)
 {
   MagickBooleanType
     status;
@@ -2268,7 +2308,7 @@ MagickExport MagickBooleanType QueryColorDatabase(const char *name,
   MagickPixelPacket
     pixel;
 
-  status=QueryMagickColor(name,&pixel,exception);
+  status=QueryMagickColorCompliance(name,compliance,&pixel,exception);
   color->opacity=ClampToQuantum(pixel.opacity);
   if (pixel.colorspace == CMYKColorspace)
     {
@@ -2294,6 +2334,41 @@ MagickExport MagickBooleanType QueryColorDatabase(const char *name,
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   Q u e r y C o l o r D a t a b a s e                                       %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  QueryColorDatabase() returns the red, green, blue, and opacity intensities
+%  for a given color name.
+%
+%  The format of the QueryColorDatabase method is:
+%
+%      MagickBooleanType QueryColorDatabase(const char *name,PixelPacket *color,
+%        ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o name: the color name (e.g. white, blue, yellow).
+%
+%    o color: the red, green, blue, and opacity intensities values of the
+%      named color in this structure.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport MagickBooleanType QueryColorDatabase(const char *name,
+  PixelPacket *color,ExceptionInfo *exception)
+{
+  return(QueryColorCompliance(name,AllCompliance,color,exception));
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %  Q u e r y C o l o r n a m e                                                %
 %                                                                             %
 %                                                                             %
@@ -2339,37 +2414,41 @@ MagickExport MagickBooleanType QueryColorname(const Image *image,
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   Q u e r y M a g i c k C o l o r                                           %
+%   Q u e r y M a g i c k C o l o r C o m p l i a n c e                       %
 %                                                                             %
 %                                                                             %
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  QueryMagickColor() returns the red, green, blue, and opacity intensities
-%  for a given color name.
+%  QueryMagickColorCompliance() returns the red, green, blue, and opacity
+%  intensities for a given color name and standards compliance.
 %
 %  The format of the QueryMagickColor method is:
 %
 %      MagickBooleanType QueryMagickColor(const char *name,
-%        MagickPixelPacket *color,ExceptionInfo *exception)
+%        const ComplianceType compliance,MagickPixelPacket *color,
+%        ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
 %    o name: the color name (e.g. white, blue, yellow).
 %
+%    o compliance: Adhere to this color standard: SVG, X11, or XPM.
+%
 %    o color: the red, green, blue, and opacity intensities values of the
 %      named color in this structure.
 %
 %    o exception: return any errors or warnings in this structure.
 %
 */
-MagickExport MagickBooleanType QueryMagickColor(const char *name,
-  MagickPixelPacket *color,ExceptionInfo *exception)
+MagickExport MagickBooleanType QueryMagickColorCompliance(const char *name,
+  const ComplianceType compliance,MagickPixelPacket *color,
+  ExceptionInfo *exception)
 {
   GeometryInfo
     geometry_info;
 
-  long
+  ssize_t
     type;
 
   MagickRealType
@@ -2381,7 +2460,7 @@ MagickExport MagickBooleanType QueryMagickColor(const char *name,
   register const ColorInfo
     *p;
 
-  register long
+  register ssize_t
     i;
 
   /*
@@ -2406,7 +2485,7 @@ MagickExport MagickBooleanType QueryMagickColor(const char *name,
       QuantumAny
         range;
 
-      unsigned long
+      size_t
         depth,
         n;
 
@@ -2423,7 +2502,7 @@ MagickExport MagickBooleanType QueryMagickColor(const char *name,
             pixel.red=pixel.green;
             pixel.green=pixel.blue;
             pixel.blue=0;
-            for (i=(long) (n/3-1); i >= 0; i--)
+            for (i=(ssize_t) (n/3-1); i >= 0; i--)
             {
               c=(*name++);
               pixel.blue<<=4;
@@ -2455,7 +2534,7 @@ MagickExport MagickBooleanType QueryMagickColor(const char *name,
             pixel.green=pixel.blue;
             pixel.blue=pixel.opacity;
             pixel.opacity=0;
-            for (i=(long) (n/4-1); i >= 0; i--)
+            for (i=(ssize_t) (n/4-1); i >= 0; i--)
             {
               c=(*name++);
               pixel.opacity<<=4;
@@ -2589,7 +2668,7 @@ MagickExport MagickBooleanType QueryMagickColor(const char *name,
   /*
     Parse named color.
   */
-  p=GetColorInfo(name,exception);
+  p=GetColorCompliance(name,compliance,exception);
   if (p == (const ColorInfo *) NULL)
     return(MagickFalse);
   color->colorspace=RGBColorspace;
@@ -2607,6 +2686,41 @@ MagickExport MagickBooleanType QueryMagickColor(const char *name,
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   Q u e r y M a g i c k C o l o r                                           %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  QueryMagickColor() returns the red, green, blue, and opacity intensities
+%  for a given color name.
+%
+%  The format of the QueryMagickColor method is:
+%
+%      MagickBooleanType QueryMagickColor(const char *name,
+%        MagickPixelPacket *color,ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o name: the color name (e.g. white, blue, yellow).
+%
+%    o color: the red, green, blue, and opacity intensities values of the
+%      named color in this structure.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport MagickBooleanType QueryMagickColor(const char *name,
+  MagickPixelPacket *color,ExceptionInfo *exception)
+{
+  return(QueryMagickColorCompliance(name,AllCompliance,color,exception));
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %  Q u e r y M a g i c k C o l o r n a m e                                    %
 %                                                                             %
 %                                                                             %
@@ -2655,9 +2769,7 @@ MagickExport MagickBooleanType QueryMagickColorname(const Image *image,
   if (compliance == XPMCompliance)
     {
       pixel.matte=MagickFalse;
-      pixel.depth=(unsigned long) MagickMin(1.0*image->depth,16.0);
-      GetColorTuple(&pixel,MagickTrue,name);
-      return(MagickTrue);
+      pixel.depth=(size_t) MagickMin(1.0*image->depth,16.0);
     }
   GetColorTuple(&pixel,compliance != SVGCompliance ? MagickTrue : MagickFalse,
     name);