Exemple #1
0
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   W r i t e M V G I m a g e                                                 %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Method WriteMVGImage writes an image to a file in MVG image format.
%
%  The format of the WriteMVGImage method is:
%
%      unsigned int WriteMVGImage(const ImageInfo *image_info,Image *image)
%
%  A description of each parameter follows.
%
%    o status: Method WriteMVGImage return True if the image is written.
%      False is returned is there is a memory shortage or if the image file
%      fails to write.
%
%    o image_info: Specifies a pointer to a ImageInfo structure.
%
%    o image:  A pointer to an Image structure.
%
%
*/
static unsigned int WriteMVGImage(const ImageInfo *image_info,Image *image)
{
  const ImageAttribute
    *attribute;

  unsigned int
    status;

  /*
    Open output image file.
  */
  assert(image_info != (const ImageInfo *) NULL);
  assert(image_info->signature == MagickSignature);
  assert(image != (Image *) NULL);
  assert(image->signature == MagickSignature);
  attribute=GetImageAttribute(image,"[MVG]");
  if (attribute == (ImageAttribute *) NULL)
    ThrowWriterException(CoderError,NoImageVectorGraphics,image);
  status=OpenBlob(image_info,image,WriteBlobMode,&image->exception);
  if (status == False)
    ThrowWriterException(FileOpenError,UnableToOpenFile,image);
  (void) WriteBlob(image,strlen(attribute->value),attribute->value);
  CloseBlob(image);
  return(True);
}
Exemple #2
0
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   W r i t e M V G I m a g e                                                 %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  WriteMVGImage() writes an image to a file in MVG image format.
%
%  The format of the WriteMVGImage method is:
%
%      MagickBooleanType WriteMVGImage(const ImageInfo *image_info,Image *image)
%
%  A description of each parameter follows.
%
%    o image_info: The image info.
%
%    o image:  The image.
%
%
*/
static MagickBooleanType WriteMVGImage(const ImageInfo *image_info,Image *image)
{
  const ImageAttribute
    *attribute;

  MagickBooleanType
    status;

  /*
    Open output image file.
  */
  assert(image_info != (const ImageInfo *) NULL);
  assert(image_info->signature == MagickSignature);
  assert(image != (Image *) NULL);
  assert(image->signature == MagickSignature);
  if (image->debug != MagickFalse)
    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
  attribute=GetImageAttribute(image,"[MVG]");
  if (attribute == (ImageAttribute *) NULL)
    ThrowWriterException(OptionError,"NoImageVectorGraphics");
  status=OpenBlob(image_info,image,WriteBlobMode,&image->exception);
  if (status == MagickFalse)
    return(status);
  (void) WriteBlob(image,strlen(attribute->value),(unsigned char *)
    attribute->value);
  CloseBlob(image);
  return(MagickTrue);
}
Exemple #3
0
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   W r i t e C I P I m a g e                                                 %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Procedure WriteCIPImage() writes an image to a file in the Cisco IP phone
%  image format.
%
%  The format of the WriteCIPImage method is:
%
%      MagickBooleanType WriteCIPImage(const ImageInfo *image_info,Image *image)
%
%  A description of each parameter follows.
%
%    o image_info: The image info.
%
%    o image:  The image.
%
%
*/
static MagickBooleanType WriteCIPImage(const ImageInfo *image_info,Image *image)
{
  char
    buffer[MaxTextExtent];

  const ImageAttribute
    *attribute;

  long
    y;

  MagickBooleanType
    status;

  register const PixelPacket
    *p;

  register long
    i,
    x;

  unsigned char
    byte;

  /*
    Open output image file.
  */
  assert(image_info != (const ImageInfo *) NULL);
  assert(image_info->signature == MagickSignature);
  assert(image != (Image *) NULL);
  assert(image->signature == MagickSignature);
  if (image->debug != MagickFalse)
    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
  status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception);
  if (status == MagickFalse)
    return(status);
  (void) WriteBlobString(image,"<CiscoIPPhoneImage>\n");
  attribute=GetImageAttribute(image,"Label");
  if (attribute != (const ImageAttribute *) NULL)
    (void) FormatMagickString(buffer,MaxTextExtent,"<Title>%s</Title>\n",
      attribute->value);
  else
    {
      char
        basename[MaxTextExtent];

      GetPathComponent(image->filename,BasePath,basename);
      (void) FormatMagickString(buffer,MaxTextExtent,"<Title>%s</Title>\n",
        basename);
    }
  (void) WriteBlobString(image,buffer);
  (void) FormatMagickString(buffer,MaxTextExtent,"<LocationX>%ld</LocationX>\n",
    image->page.x);
  (void) WriteBlobString(image,buffer);
  (void) FormatMagickString(buffer,MaxTextExtent,"<LocationY>%ld</LocationY>\n",
    image->page.y);
  (void) WriteBlobString(image,buffer);
  (void) FormatMagickString(buffer,MaxTextExtent,"<Width>%lu</Width>\n",
    image->columns+(image->columns % 2));
  (void) WriteBlobString(image,buffer);
  (void) FormatMagickString(buffer,MaxTextExtent,"<Height>%lu</Height>\n",
    image->rows);
  (void) WriteBlobString(image,buffer);
  (void) FormatMagickString(buffer,MaxTextExtent,"<Depth>2</Depth>\n");
  (void) WriteBlobString(image,buffer);
  (void) WriteBlobString(image,"<Data>");
  (void) SetImageColorspace(image,RGBColorspace);
  for (y=0; y < (long) image->rows; y++)
  {
    p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
    if (p == (const PixelPacket *) NULL)
      break;
    for (x=0; x < ((long) image->columns-3); x+=4)
    {
      byte=(unsigned char)
        (((4*PixelIntensityToQuantum(p+3)/QuantumRange) & 0x03) << 6) |
         (((4*PixelIntensityToQuantum(p+2)/QuantumRange) & 0x03) << 4) |
         (((4*PixelIntensityToQuantum(p+1)/QuantumRange) & 0x03) << 2) |
         (((4*PixelIntensityToQuantum(p+0)/QuantumRange) & 0x03) << 0);
      (void) FormatMagickString(buffer,MaxTextExtent,"%02x",byte);
      (void) WriteBlobString(image,buffer);
      p+=4;
    }
    if ((image->columns % 4) != 0)
      {
        i=(long) image->columns % 4;
        byte=(unsigned char)
          ((((4*PixelIntensityToQuantum(p+Min(i,3))/QuantumRange) & 0x03) << 6) |
           (((4*PixelIntensityToQuantum(p+Min(i,2))/QuantumRange) & 0x03) << 4) |
           (((4*PixelIntensityToQuantum(p+Min(i,1))/QuantumRange) & 0x03) << 2) |
           (((4*PixelIntensityToQuantum(p+Min(i,0))/QuantumRange) & 0x03) << 0));
        (void) FormatMagickString(buffer,MaxTextExtent,"%02x",~byte);
        (void) WriteBlobString(image,buffer);
      }
    if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
        (QuantumTick(y,image->rows) != MagickFalse))
      {
        status=image->progress_monitor(SaveImageTag,y,image->rows,
          image->client_data);
        if (status == MagickFalse)
          break;
      }
  }
  (void) WriteBlobString(image,"</Data>\n");
  (void) WriteBlobString(image,"</CiscoIPPhoneImage>\n");
  CloseBlob(image);
  return(MagickTrue);
}
Exemple #4
0
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   D e s c r i b e I m a g e                                                 %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  DescribeImage() describes an image by printing its attributes to the file.
%  Attributes include the image width, height, size, and others.
%
%  The format of the DescribeImage method is:
%
%      void DescribeImage(Image *image,FILE *file,const MagickBool verbose)
%
%  A description of each parameter follows:
%
%    o image: The image.
%
%    o file: The file, typically stdout.
%
%    o verbose: A value other than zero prints more detailed information
%      about the image. Values greater than one enable counting the number of
%      colors in the image.
%
%
*/
MagickExport MagickPassFail DescribeImage(Image *image,FILE *file,
        const MagickBool verbose)
{
    char
    color[MaxTextExtent],
          format[MaxTextExtent];

    const unsigned char
    *profile;

    size_t
    profile_length;

    const ImageAttribute
    *attribute;

    const MagickInfo
    *magick_info;

    double
    elapsed_time,
    user_time;

    unsigned long
    columns,
    rows;

    magick_int64_t
    pixels_per_second;

    Image
    *p;

    long
    y;

    register long
    i,
    x;

    unsigned long
    count;

    assert(image != (Image *) NULL);
    assert(image->signature == MagickSignature);
    assert(file != (FILE *) NULL);
    elapsed_time=GetElapsedTime(&image->timer);
    user_time=GetUserTime(&image->timer);
    GetTimerInfo(&image->timer);
    if (!verbose)
    {
        /*
          Display summary info about the image.
        */
        if (*image->magick_filename != '\0')
            if (LocaleCompare(image->magick_filename,image->filename) != 0)
                (void) fprintf(file,"%.1024s=>",image->magick_filename);
        if ((image->previous == (Image *) NULL) &&
                (image->next == (Image *) NULL) && (image->scene == 0))
            (void) fprintf(file,"%.1024s ",image->filename);
        else
            (void) fprintf(file,"%.1024s[%lu] ",image->filename,image->scene);
        (void) fprintf(file,"%.1024s ",image->magick);
        columns=image->columns;
        rows=image->rows;
        if ((image->magick_columns != 0) || (image->magick_rows != 0))
            if ((image->magick_columns != image->columns) ||
                    (image->magick_rows != image->rows))
            {
                columns=image->magick_columns;
                rows=image->magick_rows;
                (void) fprintf(file,"%lux%lu=>",image->magick_columns,
                               image->magick_rows);
            }
        (void) fprintf(file,"%lux%lu%+ld%+ld ",image->columns,image->rows,
                       image->page.x,image->page.y);
        if (image->storage_class == DirectClass)
        {
            (void) fprintf(file,"DirectClass ");
            if (image->total_colors != 0)
            {
                FormatSize(image->total_colors,format);
                (void) fprintf(file,"%.1024s ",format);
            }
        }
        else if (image->total_colors <= image->colors)
            (void) fprintf(file,"PseudoClass %uc ",image->colors);
        else
        {
            (void) fprintf(file,"PseudoClass %lu=>%uc ",image->total_colors,
                           image->colors);
            (void) fprintf(file,"%ld/%.6f/%.6fe ",
                           (long) image->error.mean_error_per_pixel,
                           image->error.normalized_mean_error,
                           image->error.normalized_maximum_error);
        }
        (void) fprintf(file,"%u-bit ",image->depth);
        if (GetBlobSize(image) != 0)
        {
            FormatSize(GetBlobSize(image),format);
            (void) fprintf(file,"%.1024s ",format);
        }
        (void) fprintf(file,"%0.3fu %ld:%02ld",user_time,
                       (long) (elapsed_time/60.0),
                       (long) ceil(fmod(elapsed_time,60.0)));
        /*
          Only display pixel read rate if the time accumulated is at
          least six times the timer's resolution (typically 0.01 on
          Unix).
        */
        if (elapsed_time >= GetTimerResolution()*6)
        {
            pixels_per_second=(magick_int64_t) ((double) rows*columns/ elapsed_time);
            FormatSize(pixels_per_second,format);
            (void) fprintf(file," (%s pixels/s)",format);
        }
        (void) fprintf(file,"\n");

        return (ferror(file) ? MagickFail : MagickPass);
    }
    /*
      Display verbose info about the image.
    */
    (void) SignatureImage(image);
    if (verbose > 1)
        image->total_colors=GetNumberColors(image,(FILE *) NULL,&image->exception);
    (void) fprintf(file,"Image: %.1024s\n",image->filename);
    magick_info=GetMagickInfo(image->magick,&image->exception);
    if ((magick_info == (const MagickInfo *) NULL) ||
            (*magick_info->description == '\0'))
        (void) fprintf(file,"  Format: %.1024s\n",image->magick);
    else
        (void) fprintf(file,"  Format: %.1024s (%.1024s)\n",image->magick,
                       magick_info->description);
    (void) fprintf(file,"  Geometry: %lux%lu\n",image->columns,image->rows);
    if (image->storage_class == DirectClass)
        (void) fprintf(file,"  Class: DirectClass\n");
    else
        (void) fprintf(file,"  Class: PseudoClass\n");
    if ((image->magick_columns != 0) || (image->magick_rows != 0))
        if ((image->magick_columns != image->columns) ||
                (image->magick_rows != image->rows))
            (void) fprintf(file,"  Base geometry: %lux%lu\n",image->magick_columns,
                           image->magick_rows);
    (void) fprintf(file,"  Type: ");
    switch (GetImageType(image,&image->exception))
    {
    case BilevelType:
        (void) fprintf(file,"bilevel");
        break;
    case GrayscaleType:
        (void) fprintf(file,"grayscale");
        break;
    case GrayscaleMatteType:
        (void) fprintf(file,"grayscale with transparency");
        break;
    case PaletteType:
        (void) fprintf(file,"palette");
        break;
    case PaletteMatteType:
        (void) fprintf(file,"palette with transparency");
        break;
    case TrueColorType:
        (void) fprintf(file,"true color");
        break;
    case TrueColorMatteType:
        (void) fprintf(file,"true color with transparency");
        break;
    case ColorSeparationType:
        (void) fprintf(file,"color separated");
        break;
    case ColorSeparationMatteType:
        (void) fprintf(file,"color separated with transparency");
        break;
    default:
        (void) fprintf(file,"undefined");
        break;
    }
    (void) fprintf(file,"\n");
    (void) fprintf(file,"  Depth: %lu bits-per-pixel component\n",
                   GetImageDepth(image,&image->exception));
    (void) fprintf(file,"  Channel Depths:\n");
    if (image->colorspace == CMYKColorspace)
    {
        (void) fprintf(file,"    Cyan:     %u bits\n",
                       GetImageChannelDepth(image,CyanChannel,&image->exception));
        (void) fprintf(file,"    Magenta:  %u bits\n",
                       GetImageChannelDepth(image,MagentaChannel,&image->exception));
        (void) fprintf(file,"    Yellow:   %u bits\n",
                       GetImageChannelDepth(image,YellowChannel,&image->exception));
        (void) fprintf(file,"    Black:    %u bits\n",
                       GetImageChannelDepth(image,BlackChannel,&image->exception));
    }
    else if ((IsGrayColorspace(image->colorspace)) ||
             (image->is_grayscale == True))
    {
        (void) fprintf(file,"    Gray:     %u bits\n",
                       GetImageChannelDepth(image,RedChannel,&image->exception));
    }
    else
    {
        (void) fprintf(file,"    Red:      %u bits\n",
                       GetImageChannelDepth(image,RedChannel,&image->exception));
        (void) fprintf(file,"    Green:    %u bits\n",
                       GetImageChannelDepth(image,GreenChannel,&image->exception));
        (void) fprintf(file,"    Blue:     %u bits\n",
                       GetImageChannelDepth(image,BlueChannel,&image->exception));
    }
    if (image->matte)
        (void) fprintf(file,"    Opacity:  %u bits\n",
                       GetImageChannelDepth(image,OpacityChannel,&image->exception));
    (void) fprintf(file,"  Channel Statistics:\n");
    {
        ImageStatistics
        statistics;

        (void) GetImageStatistics(image,&statistics,&image->exception);

        if (image->colorspace == CMYKColorspace)
        {
            (void) fprintf(file,"    Cyan:\n");
            (void) fprintf(file,"      Minimum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.red.minimum,
                           statistics.red.minimum);
            (void) fprintf(file,"      Maximum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.red.maximum,
                           statistics.red.maximum);
            (void) fprintf(file,"      Mean:               %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.red.mean,
                           statistics.red.mean);
            (void) fprintf(file,"      Standard Deviation: %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.red.standard_deviation,
                           statistics.red.standard_deviation);
            (void) fprintf(file,"    Magenta:\n");
            (void) fprintf(file,"      Minimum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.green.minimum,
                           statistics.green.minimum);
            (void) fprintf(file,"      Maximum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.green.maximum,
                           statistics.green.maximum);
            (void) fprintf(file,"      Mean:               %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.green.mean,
                           statistics.green.mean);
            (void) fprintf(file,"      Standard Deviation: %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.green.standard_deviation,
                           statistics.green.standard_deviation);
            (void) fprintf(file,"    Yellow:\n");
            (void) fprintf(file,"      Minimum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.blue.minimum,
                           statistics.blue.minimum);
            (void) fprintf(file,"      Maximum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.blue.maximum,
                           statistics.blue.maximum);
            (void) fprintf(file,"      Mean:               %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.blue.mean,
                           statistics.blue.mean);
            (void) fprintf(file,"      Standard Deviation: %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.blue.standard_deviation,
                           statistics.blue.standard_deviation);
            (void) fprintf(file,"    Black:\n");
            (void) fprintf(file,"      Minimum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.opacity.minimum,
                           statistics.opacity.minimum);
            (void) fprintf(file,"      Maximum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.opacity.maximum,
                           statistics.opacity.maximum);
            (void) fprintf(file,"      Mean:               %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.opacity.mean,
                           statistics.opacity.mean);
            (void) fprintf(file,"      Standard Deviation: %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.opacity.standard_deviation,
                           statistics.opacity.standard_deviation);
            /*
            if (image->matte)
              (void) fprintf(file,"    Opacity:\n");
            */
        }
        else if ((IsGrayColorspace(image->colorspace)) ||
                 (image->is_grayscale == True))
        {
            (void) fprintf(file,"    Gray:\n");
            (void) fprintf(file,"      Minimum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.red.minimum,
                           statistics.red.minimum);
            (void) fprintf(file,"      Maximum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.red.maximum,
                           statistics.red.maximum);
            (void) fprintf(file,"      Mean:               %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.red.mean,
                           statistics.red.mean);
            (void) fprintf(file,"      Standard Deviation: %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.red.standard_deviation,
                           statistics.red.standard_deviation);
            if (image->matte)
            {
                (void) fprintf(file,"    Opacity:\n");
                (void) fprintf(file,"      Minimum:            %13.02lf (%1.4f)\n",
                               MaxRGB*statistics.opacity.minimum,
                               statistics.opacity.minimum);
                (void) fprintf(file,"      Maximum:            %13.02lf (%1.4f)\n",
                               MaxRGB*statistics.opacity.maximum,
                               statistics.opacity.maximum);
                (void) fprintf(file,"      Mean:               %13.02lf (%1.4f)\n",
                               MaxRGB*statistics.opacity.mean,
                               statistics.opacity.mean);
                (void) fprintf(file,"      Standard Deviation: %13.02lf (%1.4f)\n",
                               MaxRGB*statistics.opacity.standard_deviation,
                               statistics.opacity.standard_deviation);
            }
        }
        else
        {
            (void) fprintf(file,"    Red:\n");
            (void) fprintf(file,"      Minimum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.red.minimum,
                           statistics.red.minimum);
            (void) fprintf(file,"      Maximum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.red.maximum,
                           statistics.red.maximum);
            (void) fprintf(file,"      Mean:               %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.red.mean,
                           statistics.red.mean);
            (void) fprintf(file,"      Standard Deviation: %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.red.standard_deviation,
                           statistics.red.standard_deviation);
            (void) fprintf(file,"    Green:\n");
            (void) fprintf(file,"      Minimum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.green.minimum,
                           statistics.green.minimum);
            (void) fprintf(file,"      Maximum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.green.maximum,
                           statistics.green.maximum);
            (void) fprintf(file,"      Mean:               %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.green.mean,
                           statistics.green.mean);
            (void) fprintf(file,"      Standard Deviation: %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.green.standard_deviation,
                           statistics.green.standard_deviation);
            (void) fprintf(file,"    Blue:\n");
            (void) fprintf(file,"      Minimum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.blue.minimum,
                           statistics.blue.minimum);
            (void) fprintf(file,"      Maximum:            %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.blue.maximum,
                           statistics.blue.maximum);
            (void) fprintf(file,"      Mean:               %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.blue.mean,
                           statistics.blue.mean);
            (void) fprintf(file,"      Standard Deviation: %13.02lf (%1.4f)\n",
                           MaxRGB*statistics.blue.standard_deviation,
                           statistics.blue.standard_deviation);
            if (image->matte)
            {
                (void) fprintf(file,"    Opacity:\n");
                (void) fprintf(file,"      Minimum:            %13.02lf (%1.4f)\n",
                               MaxRGB*statistics.opacity.minimum,
                               statistics.opacity.minimum);
                (void) fprintf(file,"      Maximum:            %13.02lf (%1.4f)\n",
                               MaxRGB*statistics.opacity.maximum,
                               statistics.opacity.maximum);
                (void) fprintf(file,"      Mean:               %13.02lf (%1.4f)\n",
                               MaxRGB*statistics.opacity.mean,
                               statistics.opacity.mean);
                (void) fprintf(file,"      Standard Deviation: %13.02lf (%1.4f)\n",
                               MaxRGB*statistics.opacity.standard_deviation,
                               statistics.opacity.standard_deviation);
            }
        }
    }
    x=0;
    p=(Image *) NULL;
    if ((image->matte && (strcmp(image->magick,"GIF") != 0)) || image->taint)
    {
        char
        tuple[MaxTextExtent];

        register const PixelPacket
        *p;

        p=(PixelPacket *) NULL;
        for (y=0; y < (long) image->rows; y++)
        {
            p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
            if (p == (const PixelPacket *) NULL)
                break;
            for (x=0; x < (long) image->columns; x++)
            {
                if (p->opacity == TransparentOpacity)
                    break;
                p++;
            }
            if (x < (long) image->columns)
                break;
        }
        if ((x < (long) image->columns) || (y < (long) image->rows))
        {
            GetColorTuple(p,image->depth,image->matte,False,tuple);
            (void) fprintf(file,"  Opacity: %.1024s\t",tuple);
            GetColorTuple(p,image->depth,image->matte,True,tuple);
            (void) fprintf(file,"  %.1024s\n",tuple);
        }
    }
    if (image->storage_class == DirectClass)
    {
        if (image->total_colors != 0)
            (void) fprintf(file,"  Colors: %lu\n",image->total_colors);
    }
    else
    {
        if (image->total_colors <= image->colors)
            (void) fprintf(file,"  Colors: %u\n",image->colors);
        else
            (void) fprintf(file,"  Colors: %lu=>%u\n",image->total_colors,
                           image->colors);
    }
    if (image->storage_class == DirectClass)
    {
        if (image->total_colors < 1024)
            if (verbose > 1)
                (void) GetNumberColors(image,file,&image->exception);
    }
    else
    {
        char
        name[MaxTextExtent];

        register PixelPacket
        *p;

        /*
          Display image colormap.
        */
        p=image->colormap;
        for (i=0; i < (long) image->colors; i++)
        {
            char
            tuple[MaxTextExtent];

            GetColorTuple(p,image->depth,image->matte,False,tuple);
            (void) fprintf(file,"    %lu: %.1024s",i,tuple);
            (void) fprintf(file,"\t");
            (void) QueryColorname(image,p,SVGCompliance,name,&image->exception);
            (void) fprintf(file,"  %.1024s",name);
            (void) fprintf(file,"\n");
            p++;
        }
    }
    if (image->error.mean_error_per_pixel != 0.0)
        (void) fprintf(file,"  Mean Exception Per Pixel: %ld\n",
                       (long) image->error.mean_error_per_pixel);
    if (image->error.normalized_mean_error != 0.0)
        (void) fprintf(file,"  Normalized Mean Exception: %g\n",
                       image->error.normalized_mean_error);
    if (image->error.normalized_maximum_error != 0.0)
        (void) fprintf(file,"  Normalized Maximum Exception: %gn",
                       image->error.normalized_maximum_error);
    if (image->rendering_intent == SaturationIntent)
        (void) fprintf(file,"  Rendering-Intent: saturation\n");
    else if (image->rendering_intent == PerceptualIntent)
        (void) fprintf(file,"  Rendering-Intent: perceptual\n");
    else if (image->rendering_intent == AbsoluteIntent)
        (void) fprintf(file,"  Rendering-Intent: absolute\n");
    else if (image->rendering_intent == RelativeIntent)
        (void) fprintf(file,"  Rendering-Intent: relative\n");
    if (image->gamma != 0.0)
        (void) fprintf(file,"  Gamma: %g\n",image->gamma);
    if ((image->chromaticity.red_primary.x != 0.0) ||
            (image->chromaticity.green_primary.x != 0.0) ||
            (image->chromaticity.blue_primary.x != 0.0) ||
            (image->chromaticity.white_point.x != 0.0))
    {
        /*
          Display image chromaticity.
        */
        (void) fprintf(file,"  Chromaticity:\n");
        (void) fprintf(file,"    red primary: (%g,%g)\n",
                       image->chromaticity.red_primary.x,image->chromaticity.red_primary.y);
        (void) fprintf(file,"    green primary: (%g,%g)\n",
                       image->chromaticity.green_primary.x,
                       image->chromaticity.green_primary.y);
        (void) fprintf(file,"    blue primary: (%g,%g)\n",
                       image->chromaticity.blue_primary.x,image->chromaticity.blue_primary.y);
        (void) fprintf(file,"    white point: (%g,%g)\n",
                       image->chromaticity.white_point.x,image->chromaticity.white_point.y);
    }
    if ((image->tile_info.width*image->tile_info.height) != 0)
        (void) fprintf(file,"  Tile geometry: %lux%lu%+ld%+ld\n",
                       image->tile_info.width,image->tile_info.height,image->tile_info.x,
                       image->tile_info.y);
    if ((image->x_resolution != 0.0) && (image->y_resolution != 0.0))
    {
        /*
          Display image resolution.
        */
        (void) fprintf(file,"  Resolution: %gx%g",image->x_resolution,
                       image->y_resolution);
        if (image->units == UndefinedResolution)
            (void) fprintf(file," pixels\n");
        else if (image->units == PixelsPerInchResolution)
            (void) fprintf(file," pixels/inch\n");
        else if (image->units == PixelsPerCentimeterResolution)
            (void) fprintf(file," pixels/centimeter\n");
        else
            (void) fprintf(file,"\n");
    }
    FormatSize(GetBlobSize(image),format);
    (void) fprintf(file,"  Filesize: %.1024s\n",format);
    fprintf(file,"  Interlace: %s\n",
            InterlaceTypeToString(image->interlace == UndefinedInterlace ?
                                  NoInterlace : image->interlace));
    (void) fprintf(file,"  Orientation: %s\n", OrientationTypeToString(image->orientation));
    (void) QueryColorname(image,&image->background_color,SVGCompliance,color,
                          &image->exception);
    (void) fprintf(file,"  Background Color: %.1024s\n",color);
    (void) QueryColorname(image,&image->border_color,SVGCompliance,color,
                          &image->exception);
    (void) fprintf(file,"  Border Color: %.1024s\n",color);
    (void) QueryColorname(image,&image->matte_color,SVGCompliance,color,
                          &image->exception);
    (void) fprintf(file,"  Matte Color: %.1024s\n",color);
    if ((image->page.width != 0) && (image->page.height != 0))
        (void) fprintf(file,"  Page geometry: %lux%lu%+ld%+ld\n",image->page.width,
                       image->page.height,image->page.x,image->page.y);
    (void) fprintf(file,"  Compose: %s\n",
                   CompositeOperatorToString(image->compose));
    (void) fprintf(file,"  Dispose: ");
    switch (image->dispose)
    {
    case UndefinedDispose:
        (void) fprintf(file,"Undefined\n");
        break;
    case NoneDispose:
        (void) fprintf(file,"None\n");
        break;
    case BackgroundDispose:
        (void) fprintf(file,"Background\n");
        break;
    case PreviousDispose:
        (void) fprintf(file,"Previous\n");
        break;
    default:
        (void) fprintf(file,"\n");
        break;
    }
    if (image->delay != 0)
        (void) fprintf(file,"  Delay: %lu\n",image->delay);
    if (image->iterations != 1)
        (void) fprintf(file,"  Iterations: %lu\n",image->iterations);
    p=image;
    while (p->previous != (Image *) NULL)
        p=p->previous;
    for (count=1; p->next != (Image *) NULL; count++)
        p=p->next;
    if (count > 1)
        (void) fprintf(file,"  Scene: %lu of %lu\n",image->scene,count);
    else if (image->scene != 0)
        (void) fprintf(file,"  Scene: %lu\n",image->scene);
    (void) fprintf(file,"  Compression: %s\n",
                   CompressionTypeToString(image->compression));
    /*
      Display formatted image attributes. This must happen before we access
      any pseudo attributes like EXIF since doing so causes real attributes
      to be created and we would get duplicates in the output.
    */
    attribute=GetImageAttribute(image,(char *) NULL);
    {
        for ( ; attribute != (const ImageAttribute *) NULL; attribute=attribute->next)
        {
            if (LocaleNCompare("EXIF",attribute->key,4) != 0)
            {
                (void) fprintf(file,"  %c", toupper((int)attribute->key[0]));
                if (strlen(attribute->key) > 1)
                    (void) fprintf(file,"%.1024s",attribute->key+1);

                (void) fprintf(file,": ");
                (void) fprintf(file,"%s\n",attribute->value);
            }
        }
    }
    if((profile=GetImageProfile(image,"ICM",&profile_length)) != 0)
        (void) fprintf(file,"  Profile-color: %lu bytes\n",(unsigned long)
                       profile_length);
    if((profile=GetImageProfile(image,"IPTC",&profile_length)) != 0)
    {
        char
        *tag,
        *text;

        size_t
        length;

        /*
          Describe IPTC data.
        */
        (void) fprintf(file,"  Profile-iptc: %lu bytes\n",(unsigned long)
                       profile_length);
        for (i=0; i < (long) profile_length; )
        {
            if (profile[i] != 0x1c)
            {
                i++;
                continue;
            }
            i++;  /* skip file separator */
            i++;  /* skip record number */
            switch (profile[i])
            {
            case 5:
                tag=(char *) "Image Name";
                break;
            case 7:
                tag=(char *) "Edit Status";
                break;
            case 10:
                tag=(char *) "Priority";
                break;
            case 15:
                tag=(char *) "Category";
                break;
            case 20:
                tag=(char *) "Supplemental Category";
                break;
            case 22:
                tag=(char *) "Fixture Identifier";
                break;
            case 25:
                tag=(char *) "Keyword";
                break;
            case 30:
                tag=(char *) "Release Date";
                break;
            case 35:
                tag=(char *) "Release Time";
                break;
            case 40:
                tag=(char *) "Special Instructions";
                break;
            case 45:
                tag=(char *) "Reference Service";
                break;
            case 47:
                tag=(char *) "Reference Date";
                break;
            case 50:
                tag=(char *) "Reference Number";
                break;
            case 55:
                tag=(char *) "Created Date";
                break;
            case 60:
                tag=(char *) "Created Time";
                break;
            case 65:
                tag=(char *) "Originating Program";
                break;
            case 70:
                tag=(char *) "Program Version";
                break;
            case 75:
                tag=(char *) "Object Cycle";
                break;
            case 80:
                tag=(char *) "Byline";
                break;
            case 85:
                tag=(char *) "Byline Title";
                break;
            case 90:
                tag=(char *) "City";
                break;
            case 95:
                tag=(char *) "Province State";
                break;
            case 100:
                tag=(char *) "Country Code";
                break;
            case 101:
                tag=(char *) "Country";
                break;
            case 103:
                tag=(char *) "Original Transmission Reference";
                break;
            case 105:
                tag=(char *) "Headline";
                break;
            case 110:
                tag=(char *) "Credit";
                break;
            case 115:
                tag=(char *) "Source";
                break;
            case 116:
                tag=(char *) "Copyright String";
                break;
            case 120:
                tag=(char *) "Caption";
                break;
            case 121:
                tag=(char *) "Local Caption";
                break;
            case 122:
                tag=(char *) "Caption Writer";
                break;
            case 200:
                tag=(char *) "Custom Field 1";
                break;
            case 201:
                tag=(char *) "Custom Field 2";
                break;
            case 202:
                tag=(char *) "Custom Field 3";
                break;
            case 203:
                tag=(char *) "Custom Field 4";
                break;
            case 204:
                tag=(char *) "Custom Field 5";
                break;
            case 205:
                tag=(char *) "Custom Field 6";
                break;
            case 206:
                tag=(char *) "Custom Field 7";
                break;
            case 207:
                tag=(char *) "Custom Field 8";
                break;
            case 208:
                tag=(char *) "Custom Field 9";
                break;
            case 209:
                tag=(char *) "Custom Field 10";
                break;
            case 210:
                tag=(char *) "Custom Field 11";
                break;
            case 211:
                tag=(char *) "Custom Field 12";
                break;
            case 212:
                tag=(char *) "Custom Field 13";
                break;
            case 213:
                tag=(char *) "Custom Field 14";
                break;
            case 214:
                tag=(char *) "Custom Field 15";
                break;
            case 215:
                tag=(char *) "Custom Field 16";
                break;
            case 216:
                tag=(char *) "Custom Field 17";
                break;
            case 217:
                tag=(char *) "Custom Field 18";
                break;
            case 218:
                tag=(char *) "Custom Field 19";
                break;
            case 219:
                tag=(char *) "Custom Field 20";
                break;
            default:
                tag=(char *) "unknown";
                break;
            }
            i++;
            (void) fprintf(file,"    %.1024s:\n",tag);
            length=profile[i++] << 8;
            length|=profile[i++];
            text=MagickAllocateMemory(char *,length+1);
            if (text != (char *) NULL)
            {
                char
                **textlist;

                register long
                j;

                (void) strncpy(text,(char *) profile+i,length);
                text[length]='\0';
                textlist=StringToList(text);
                if (textlist != (char **) NULL)
                {
                    for (j=0; textlist[j] != (char *) NULL; j++)
                    {
                        (void) fprintf(file,"  %s\n",textlist[j]);
                        MagickFreeMemory(textlist[j]);
                    }
                    MagickFreeMemory(textlist);
                }
                MagickFreeMemory(text);
            }
            i+=length;
        }
    }