home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sources / bugs / 317 < prev    next >
Encoding:
Text File  |  1992-12-23  |  62.1 KB  |  2,111 lines

  1. Newsgroups: comp.sources.bugs
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!darwin.sura.net!udel!louie!eplrx7!eplrx7.es.dupont.com!cristy
  3. From: cristy@eplrx7.es.duPont.com (Cristy)
  4. Subject: ImageMagick 2.2 - patch #3
  5. Message-ID: <cristy.725168085@eplrx7.es.dupont.com>
  6. Summary: X11 image processing and display utilities
  7. Keywords: UNIX VMS X11 SGI DEC Cray Sun Vax
  8. Organization: DuPont Engineering Physics Laboratory
  9. Date: Thu, 24 Dec 1992 03:34:45 GMT
  10. Lines: 2099
  11.  
  12.  
  13.                     ImageMagick 2.2 Patch #3
  14.  
  15. To apply this patch:
  16.  
  17. cd to the top of the source tree (to the directory containing the
  18. "ImageMagick" subdirectories) and do:
  19.  
  20.   patch -p < ThisFile
  21.  
  22. Prereq: ImageMagick 2.2.2 (posted from comp.sources.misc, Volume 34,
  23. Issue 28 + Patch 1 & 2).
  24.  
  25. Alternatively get the entire distribution as contrib/ImageMagick.tar.Z
  26. on export.lcs.mit.edu.  I will post this patch to comp.sources.misc in
  27. a few days.
  28.  
  29.  
  30. diff -r -c ImageMagick/ChangeLog ImageMagick2.2.3/ChangeLog
  31. *** ImageMagick/ChangeLog    Tue Dec 22 16:07:20 1992
  32. --- ImageMagick2.2.3/ChangeLog    Wed Dec 23 18:10:05 1992
  33. ***************
  34. *** 1,3 ****
  35. --- 1,12 ----
  36. + ImageMagick 2.2.3
  37. +   o Non-color reduced images were being written even though the color
  38. +     reduction option was specified (-colors).  This affected images written
  39. +     as AVS, CMYK, and RGB.
  40. +   o Modified various sources to reduce lint warnings.
  41.   ImageMagick 2.2.2
  42.   
  43.     o Dithering did not work properly on the Cray (due to right shift problem).
  44. diff -r -c ImageMagick/X.c ImageMagick2.2.3/X.c
  45. *** ImageMagick/X.c    Tue Dec 22 16:06:18 1992
  46. --- ImageMagick2.2.3/X.c    Wed Dec 23 18:10:01 1992
  47. ***************
  48. *** 73,81 ****
  49. --- 73,89 ----
  50.   int
  51.     Latin1Compare _Declare((char *,char *));
  52.   
  53. + static unsigned int
  54. +   XReadColormap _Declare((Display *,XWindowAttributes *,XColor **));
  55.   static void
  56.     XMakeImageLSBFirst _Declare((XWindowInfo *,Image *, XImage *)),
  57.     XMakeImageMSBFirst _Declare((XWindowInfo *,Image *, XImage *));
  58. + static Window
  59. +   XClientWindow _Declare((Display *,Window)),
  60. +   XSelectWindow _Declare((Display *,XRectangle *)),
  61. +   XWindowByProperty _Declare((Display *,Window,Atom));
  62.   
  63.   /*
  64.   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  65. ***************
  66. *** 221,227 ****
  67.   %
  68.   %
  69.   */
  70. ! void Latin1Upper(string)
  71.   char
  72.     *string;
  73.   {
  74. --- 229,235 ----
  75.   %
  76.   %
  77.   */
  78. ! static void Latin1Upper(string)
  79.   char
  80.     *string;
  81.   {
  82. ***************
  83. *** 1296,1302 ****
  84.       Initialize graphics info.
  85.     */
  86.     graphic_context_value.background=0;
  87. !   graphic_context_value.foreground=(~0);
  88.     graphic_context_value.font=annotate_info->font_info->fid;
  89.     graphic_context=XCreateGC(display,window->id,GCBackground | GCFont |
  90.       GCForeground,&graphic_context_value);
  91. --- 1304,1310 ----
  92.       Initialize graphics info.
  93.     */
  94.     graphic_context_value.background=0;
  95. !   graphic_context_value.foreground=(unsigned long) (~0);
  96.     graphic_context_value.font=annotate_info->font_info->fid;
  97.     graphic_context=XCreateGC(display,window->id,GCBackground | GCFont |
  98.       GCForeground,&graphic_context_value);
  99. ***************
  100. *** 1711,1717 ****
  101.       Find closest representation for the requested RGB color.
  102.     */
  103.     color->pixel=0;
  104. !   min_distance=(~0);
  105.     for (i=0; i < number_colors; i++)
  106.     {
  107.       red_distance=(colors[i].red >> 8)-(color->red >> 8);
  108. --- 1719,1725 ----
  109.       Find closest representation for the requested RGB color.
  110.     */
  111.     color->pixel=0;
  112. !   min_distance=(unsigned long) (~0);
  113.     for (i=0; i < number_colors; i++)
  114.     {
  115.       red_distance=(colors[i].red >> 8)-(color->red >> 8);
  116. ***************
  117. *** 2019,2025 ****
  118.   %
  119.   %
  120.   */
  121. ! Window XClientWindow(display,target_window)
  122.   Display
  123.     *display;
  124.   
  125. --- 2027,2033 ----
  126.   %
  127.   %
  128.   */
  129. ! static Window XClientWindow(display,target_window)
  130.   Display
  131.     *display;
  132.   
  133. ***************
  134. *** 2993,2999 ****
  135.                 /*
  136.                   Advance to the next scanline.
  137.                 */
  138. !               if (bit > 0)
  139.                   *q=byte >> (8-bit);
  140.                 q+=scanline_pad;
  141.                 bit=0;
  142. --- 3001,3007 ----
  143.                 /*
  144.                   Advance to the next scanline.
  145.                 */
  146. !               if (bit != 0)
  147.                   *q=byte >> (8-bit);
  148.                 q+=scanline_pad;
  149.                 bit=0;
  150. ***************
  151. *** 3484,3490 ****
  152.                 /*
  153.                   Advance to the next scanline.
  154.                 */
  155. !               if (bit > 0)
  156.                   *q=byte << (8-bit);
  157.                 q+=scanline_pad;
  158.                 bit=0;
  159. --- 3492,3498 ----
  160.                 /*
  161.                   Advance to the next scanline.
  162.                 */
  163. !               if (bit != 0)
  164.                   *q=byte << (8-bit);
  165.                 q+=scanline_pad;
  166.                 bit=0;
  167. ***************
  168. *** 5357,5363 ****
  169.           status=XGetWindowProperty(display,XRootWindow(display,0),XA_CUT_BUFFER0,
  170.             0L,2047L,False,XA_STRING,&type,&format,&length,&after,&data);
  171.           if ((status != Success) || (type != XA_STRING) || (format == 32) ||
  172. !             (length <= 0))
  173.             break;
  174.           /*
  175.             Append cut buffer to reply.
  176. --- 5365,5371 ----
  177.           status=XGetWindowProperty(display,XRootWindow(display,0),XA_CUT_BUFFER0,
  178.             0L,2047L,False,XA_STRING,&type,&format,&length,&after,&data);
  179.           if ((status != Success) || (type != XA_STRING) || (format == 32) ||
  180. !             (length == 0))
  181.             break;
  182.           /*
  183.             Append cut buffer to reply.
  184. ***************
  185. *** 5527,5533 ****
  186.   %
  187.   %
  188.   */
  189. ! unsigned int XReadColormap(display,window_attributes,colors)
  190.   Display
  191.     *display;
  192.   
  193. --- 5535,5541 ----
  194.   %
  195.   %
  196.   */
  197. ! static unsigned int XReadColormap(display,window_attributes,colors)
  198.   Display
  199.     *display;
  200.   
  201. ***************
  202. *** 5727,5733 ****
  203.   %
  204.   %
  205.   */
  206. ! Window XSelectWindow(display,clip_info)
  207.   Display
  208.     *display;
  209.   
  210. --- 5735,5741 ----
  211.   %
  212.   %
  213.   */
  214. ! static Window XSelectWindow(display,clip_info)
  215.   Display
  216.     *display;
  217.   
  218. ***************
  219. *** 6102,6108 ****
  220.   %
  221.   %
  222.   */
  223. ! Window XWindowByProperty(display,window,property)
  224.   Display
  225.     *display;
  226.   
  227. --- 6110,6116 ----
  228.   %
  229.   %
  230.   */
  231. ! static Window XWindowByProperty(display,window,property)
  232.   Display
  233.     *display;
  234.   
  235. diff -r -c ImageMagick/X.h ImageMagick2.2.3/X.h
  236. *** ImageMagick/X.h    Tue Dec 22 16:04:15 1992
  237. --- ImageMagick2.2.3/X.h    Wed Dec 23 18:10:04 1992
  238. ***************
  239. *** 266,279 ****
  240.       unsigned int,unsigned int)),
  241.     XMakePixmap _Declare((Display *,XResourceInfo *,XWindowInfo *)),
  242.     XPopupMenu _Declare((Display *,XWindowInfo *,int,int,char *,char **,
  243. !     unsigned int,char *)),
  244. !   XReadColormap _Declare((Display *,XWindowAttributes *,XColor **));
  245.   
  246.   extern XVisualInfo 
  247.     *XBestVisualInfo _Declare((Display *,char *,char *,XStandardColormap *));
  248.   
  249.   extern void 
  250. -   Latin1Upper _Declare((char *)),
  251.     XBestIconSize _Declare((Display *,XWindowInfo *,Image *)),
  252.     XFreeStandardColormap _Declare((Display *,XVisualInfo *,XPixelInfo *,
  253.       XStandardColormap *)),
  254. --- 266,277 ----
  255.       unsigned int,unsigned int)),
  256.     XMakePixmap _Declare((Display *,XResourceInfo *,XWindowInfo *)),
  257.     XPopupMenu _Declare((Display *,XWindowInfo *,int,int,char *,char **,
  258. !     unsigned int,char *));
  259.   
  260.   extern XVisualInfo 
  261.     *XBestVisualInfo _Declare((Display *,char *,char *,XStandardColormap *));
  262.   
  263.   extern void 
  264.     XBestIconSize _Declare((Display *,XWindowInfo *,Image *)),
  265.     XFreeStandardColormap _Declare((Display *,XVisualInfo *,XPixelInfo *,
  266.       XStandardColormap *)),
  267. ***************
  268. *** 291,299 ****
  269.     XRefreshWindow _Declare((Display *,XWindowInfo *,XEvent *));
  270.   
  271.   extern Window 
  272. -   XClientWindow _Declare((Display *,Window)),
  273. -   XWindowByProperty _Declare((Display *,Window,Atom)),
  274. -   XSelectWindow _Declare((Display *,XRectangle *)),
  275.     XWindowByID _Declare((Display *,Window,unsigned long)),
  276.     XWindowByName _Declare((Display *,Window,char *));
  277.   
  278. --- 289,294 ----
  279. diff -r -c ImageMagick/XtoPS.c ImageMagick2.2.3/XtoPS.c
  280. *** ImageMagick/XtoPS.c    Tue Dec 22 16:04:16 1992
  281. --- ImageMagick2.2.3/XtoPS.c    Wed Dec 23 18:10:01 1992
  282. ***************
  283. *** 428,434 ****
  284.     /*
  285.       Read image from X server.
  286.     */
  287. !   if (resource_info.delay > 0)
  288.       (void) sleep(resource_info.delay);
  289.     start_time=time((time_t *) 0);
  290.     image=ReadXImage(target_window,server_name,frame,screen,borders);
  291. --- 428,434 ----
  292.     /*
  293.       Read image from X server.
  294.     */
  295. !   if (resource_info.delay != 0)
  296.       (void) sleep(resource_info.delay);
  297.     start_time=time((time_t *) 0);
  298.     image=ReadXImage(target_window,server_name,frame,screen,borders);
  299. ***************
  300. *** 469,475 ****
  301.           (void) fprintf(stderr," DirectClass ");
  302.         else
  303.           (void) fprintf(stderr," PseudoClass ");
  304. !       (void) fprintf(stderr,"%uc %s %ds\n",image->colors,image->magick,
  305.           time((time_t *) 0)-start_time+1);
  306.       }
  307.     DestroyImage(image);
  308. --- 469,475 ----
  309.           (void) fprintf(stderr," DirectClass ");
  310.         else
  311.           (void) fprintf(stderr," PseudoClass ");
  312. !       (void) fprintf(stderr,"%uc %s %lds\n",image->colors,image->magick,
  313.           time((time_t *) 0)-start_time+1);
  314.       }
  315.     DestroyImage(image);
  316. diff -r -c ImageMagick/alien.c ImageMagick2.2.3/alien.c
  317. *** ImageMagick/alien.c    Tue Dec 22 16:04:18 1992
  318. --- ImageMagick2.2.3/alien.c    Wed Dec 23 18:10:02 1992
  319. ***************
  320. *** 665,671 ****
  321.       /*
  322.         Read image attributes.
  323.       */
  324. !     if (image_count > 0)
  325.         {
  326.           /*
  327.             Allocate image structure.
  328. --- 665,671 ----
  329.       /*
  330.         Read image attributes.
  331.       */
  332. !     if (image_count != 0)
  333.         {
  334.           /*
  335.             Allocate image structure.
  336. ***************
  337. *** 2264,2270 ****
  338.           if ((number_planes % 2) == 0)
  339.             (void) fgetc(image->file);
  340.         }
  341. !     if (number_colormaps > 0)
  342.         {
  343.           /*
  344.             Read image colormaps.
  345. --- 2264,2270 ----
  346.           if ((number_planes % 2) == 0)
  347.             (void) fgetc(image->file);
  348.         }
  349. !     if (number_colormaps != 0)
  350.         {
  351.           /*
  352.             Read image colormaps.
  353. ***************
  354. *** 2457,2463 ****
  355.         }
  356.         opcode=fgetc(image->file);
  357.       }
  358. !     if (number_colormaps > 0)
  359.         {
  360.           unsigned char
  361.             pixel;
  362. --- 2457,2463 ----
  363.         }
  364.         opcode=fgetc(image->file);
  365.       }
  366. !     if (number_colormaps != 0)
  367.         {
  368.           unsigned char
  369.             pixel;
  370. ***************
  371. *** 4094,4100 ****
  372.     /*
  373.       Read colormap.
  374.     */
  375. !   if (header.ncolors > 0)
  376.       {
  377.         colors=(XColor *) malloc((unsigned int) header.ncolors*sizeof(XColor));
  378.         if (colors == (XColor *) NULL)
  379. --- 4094,4100 ----
  380.     /*
  381.       Read colormap.
  382.     */
  383. !   if (header.ncolors != 0)
  384.       {
  385.         colors=(XColor *) malloc((unsigned int) header.ncolors*sizeof(XColor));
  386.         if (colors == (XColor *) NULL)
  387. ***************
  388. *** 4288,4294 ****
  389.       Free image and colormap.
  390.     */
  391.     (void) free((char *) window_name);
  392. !   if (header.ncolors > 0)
  393.       (void) free((char *) colors);
  394.     XDestroyImage(ximage);
  395.     CloseImage(image);
  396. --- 4288,4294 ----
  397.       Free image and colormap.
  398.     */
  399.     (void) free((char *) window_name);
  400. !   if (header.ncolors != 0)
  401.       (void) free((char *) colors);
  402.     XDestroyImage(ximage);
  403.     CloseImage(image);
  404. ***************
  405. *** 5227,5233 ****
  406.                 /*
  407.                   Advance to the next scanline.
  408.                 */
  409. !               if (bit > 0)
  410.                   *q++=byte << (8-bit);
  411.                 bit=0;
  412.                 byte=0;
  413. --- 5227,5233 ----
  414.                 /*
  415.                   Advance to the next scanline.
  416.                 */
  417. !               if (bit != 0)
  418.                   *q++=byte << (8-bit);
  419.                 bit=0;
  420.                 byte=0;
  421. ***************
  422. *** 5255,5290 ****
  423.       }
  424.       case '6':
  425.       {
  426. -       unsigned short int
  427. -         index;
  428.         /*
  429.           Convert image to a PNM image.
  430.         */
  431.         (void) fprintf(image->file,"%d\n",MaxRGB);
  432. !       if (image->class == DirectClass)
  433. !         for (i=0; i < image->packets; i++)
  434.           {
  435. !           for (j=0; j <= ((int) p->length); j++)
  436. !           {
  437. !             *q++=p->red;
  438. !             *q++=p->green;
  439. !             *q++=p->blue;
  440. !           }
  441. !           p++;
  442.           }
  443. !       else
  444. !         for (i=0; i < image->packets; i++)
  445. !         {
  446. !           for (j=0; j <= ((int) p->length); j++)
  447. !           {
  448. !             index=p->index;
  449. !             *q++=image->colormap[index].red;
  450. !             *q++=image->colormap[index].green;
  451. !             *q++=image->colormap[index].blue;
  452. !           }
  453. !           p++;
  454. !         }
  455.         break;
  456.       }
  457.     }
  458. --- 5255,5274 ----
  459.       }
  460.       case '6':
  461.       {
  462.         /*
  463.           Convert image to a PNM image.
  464.         */
  465.         (void) fprintf(image->file,"%d\n",MaxRGB);
  466. !       for (i=0; i < image->packets; i++)
  467. !       {
  468. !         for (j=0; j <= ((int) p->length); j++)
  469.           {
  470. !           *q++=p->red;
  471. !           *q++=p->green;
  472. !           *q++=p->blue;
  473.           }
  474. !         p++;
  475. !       }
  476.         break;
  477.       }
  478.     }
  479. ***************
  480. *** 5627,5633 ****
  481.                     /*
  482.                       Advance to the next scanline.
  483.                     */
  484. !                   if (bit > 0)
  485.                       *q++=byte << (8-bit);
  486.                     if (TIFFWriteScanline(file,scanline,y,0) < 0)
  487.                       break;
  488. --- 5611,5617 ----
  489.                     /*
  490.                       Advance to the next scanline.
  491.                     */
  492. !                   if (bit != 0)
  493.                       *q++=byte << (8-bit);
  494.                     if (TIFFWriteScanline(file,scanline,y,0) < 0)
  495.                       break;
  496. ***************
  497. *** 5643,5649 ****
  498.           }
  499.     (void) free((char *) scanline);
  500.     (void) TIFFFlushData(file);
  501. !   if (verbose)
  502.       TIFFPrintDirectory(file,stderr,False);
  503.     (void) TIFFClose(file);
  504.     return(True);
  505. --- 5627,5633 ----
  506.           }
  507.     (void) free((char *) scanline);
  508.     (void) TIFFFlushData(file);
  509. !   if (verbose == True)
  510.       TIFFPrintDirectory(file,stderr,False);
  511.     (void) TIFFClose(file);
  512.     return(True);
  513. ***************
  514. *** 5930,5936 ****
  515.                   /*
  516.                     Advance to the next scanline.
  517.                   */
  518. !                 if (bit > 0)
  519.                     *q++=byte << (8-bit);
  520.                   if ((((image->columns/8)+
  521.                       (image->columns % 8 ? 1 : 0)) % 2) != 0)
  522. --- 5914,5920 ----
  523.                   /*
  524.                     Advance to the next scanline.
  525.                   */
  526. !                 if (bit != 0)
  527.                     *q++=byte << (8-bit);
  528.                   if ((((image->columns/8)+
  529.                       (image->columns % 8 ? 1 : 0)) % 2) != 0)
  530. ***************
  531. *** 6065,6071 ****
  532.         x++;
  533.         if (x == image->columns)
  534.           {
  535. !           if (bit > 0)
  536.               {
  537.                 /*
  538.                   Write a bitmap byte to the image file.
  539. --- 6049,6055 ----
  540.         x++;
  541.         if (x == image->columns)
  542.           {
  543. !           if (bit != 0)
  544.               {
  545.                 /*
  546.                   Write a bitmap byte to the image file.
  547. diff -r -c ImageMagick/animate.c ImageMagick2.2.3/animate.c
  548. *** ImageMagick/animate.c    Tue Dec 22 16:04:19 1992
  549. --- ImageMagick2.2.3/animate.c    Wed Dec 23 18:10:02 1992
  550. ***************
  551. *** 169,175 ****
  552.   {
  553.   }
  554.   
  555. ! void Delay(milliseconds)
  556.   unsigned long
  557.     milliseconds;
  558.   {
  559. --- 169,175 ----
  560.   {
  561.   }
  562.   
  563. ! static void Delay(milliseconds)
  564.   unsigned long
  565.     milliseconds;
  566.   {
  567. ***************
  568. *** 1967,1972 ****
  569. --- 1967,1976 ----
  570.         }
  571.       else
  572.         {
  573. +         double
  574. +           normalized_maximum_error,
  575. +           normalized_mean_error;
  576.           Image
  577.             *image,
  578.             info_image,
  579. ***************
  580. *** 1975,1980 ****
  581. --- 1979,1987 ----
  582.           time_t
  583.             start_time;
  584.   
  585. +         unsigned int
  586. +           mean_error_per_pixel;
  587.           unsigned long
  588.             total_colors;
  589.   
  590. ***************
  591. *** 1992,1997 ****
  592. --- 1999,2005 ----
  593.           do
  594.           {
  595.             info_image=(*image);
  596. +           total_colors=0;
  597.             /*
  598.               Transform image as defined by the clip, image and scale geometries.
  599.             */
  600. ***************
  601. *** 2029,2053 ****
  602.               }
  603.             if (gamma > 0.0)
  604.               GammaImage(image,gamma);
  605. -           if (verbose)
  606. -             {
  607. -               /*
  608. -                 Initialize image error attributes.
  609. -               */
  610. -               if (image->class == DirectClass)
  611. -                 image->colors=NumberColors(image,(FILE *) NULL);
  612. -               total_colors=image->colors;
  613. -             }
  614.             if (resource_info.colorspace == GRAYColorspace)
  615.               QuantizeImage(image,256,8,resource_info.dither,GRAYColorspace,True);
  616.             if (resource_info.monochrome)
  617.               QuantizeImage(image,2,8,resource_info.dither,GRAYColorspace,True);
  618. !           if (resource_info.number_colors > 0)
  619.               if ((image->class == DirectClass) ||
  620.                   (image->colors > resource_info.number_colors))
  621. !               QuantizeImage(image,resource_info.number_colors,
  622. !                 resource_info.tree_depth,resource_info.dither,
  623. !                 resource_info.colorspace,True);
  624.             if (verbose)
  625.               {
  626.                 /*
  627. --- 2037,2067 ----
  628.               }
  629.             if (gamma > 0.0)
  630.               GammaImage(image,gamma);
  631.             if (resource_info.colorspace == GRAYColorspace)
  632.               QuantizeImage(image,256,8,resource_info.dither,GRAYColorspace,True);
  633.             if (resource_info.monochrome)
  634.               QuantizeImage(image,2,8,resource_info.dither,GRAYColorspace,True);
  635. !           if (resource_info.number_colors != 0)
  636.               if ((image->class == DirectClass) ||
  637.                   (image->colors > resource_info.number_colors))
  638. !               {
  639. !                 /*
  640. !                   Reduce the number of colors in the image.
  641. !                 */
  642. !                 QuantizeImage(image,resource_info.number_colors,
  643. !                   resource_info.tree_depth,resource_info.dither,
  644. !                   resource_info.colorspace,True);
  645. !                 if (verbose)
  646. !                   {
  647. !                     /*
  648. !                       Measure quantization error.
  649. !                     */
  650. !                     QuantizationError(image,&mean_error_per_pixel,
  651. !                       &normalized_mean_error,&normalized_maximum_error);
  652. !                     total_colors=NumberColors(image,(FILE *) NULL);
  653. !                   }
  654. !                 SyncImage(image);
  655. !               }
  656.             if (verbose)
  657.               {
  658.                 /*
  659. ***************
  660. *** 2065,2087 ****
  661.                   (void) fprintf(stderr," DirectClass ");
  662.                 else
  663.                   (void) fprintf(stderr," PseudoClass ");
  664. !               if (total_colors != image->colors)
  665. !                 (void) fprintf(stderr,"%lu=>",total_colors);
  666. !               (void) fprintf(stderr,"%uc",image->colors);
  667. !               if ((resource_info.number_colors > 0) || resource_info.monochrome)
  668.                   {
  669. !                   double
  670. !                     normalized_maximum_error,
  671. !                     normalized_mean_error;
  672. !                   unsigned int
  673. !                     mean_error_per_pixel;
  674. !                   /*
  675. !                     Measure quantization error.
  676. !                   */
  677. !                   QuantizationError(image,&mean_error_per_pixel,
  678. !                     &normalized_mean_error,&normalized_maximum_error);
  679.                     (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  680.                       normalized_mean_error,normalized_maximum_error);
  681.                   }
  682. --- 2079,2089 ----
  683.                   (void) fprintf(stderr," DirectClass ");
  684.                 else
  685.                   (void) fprintf(stderr," PseudoClass ");
  686. !               if (total_colors == 0)
  687. !                 (void) fprintf(stderr,"%uc",image->colors);
  688. !               else
  689.                   {
  690. !                   (void) fprintf(stderr,"%lu=>%uc",total_colors,image->colors);
  691.                     (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  692.                       normalized_mean_error,normalized_maximum_error);
  693.                   }
  694. diff -r -c ImageMagick/colors.c ImageMagick2.2.3/colors.c
  695. *** ImageMagick/colors.c    Tue Dec 22 16:04:19 1992
  696. --- ImageMagick2.2.3/colors.c    Wed Dec 23 18:10:02 1992
  697. ***************
  698. *** 156,162 ****
  699.       if (node->child[id] != (Node *) NULL)
  700.         Histogram(node->child[id],file);
  701.     if (node->level == MaxTreeDepth)
  702. !     (void) fprintf(file,"%8d\t%d\t%d\t%d\n",node->number_colors,
  703.         node->mid_red,node->mid_green,node->mid_blue);
  704.   }
  705.   
  706. --- 156,162 ----
  707.       if (node->child[id] != (Node *) NULL)
  708.         Histogram(node->child[id],file);
  709.     if (node->level == MaxTreeDepth)
  710. !     (void) fprintf(file,"%8lu\t%d\t%d\t%d\n",node->number_colors,
  711.         node->mid_red,node->mid_green,node->mid_blue);
  712.   }
  713.   
  714. diff -r -c ImageMagick/compress.c ImageMagick2.2.3/compress.c
  715. *** ImageMagick/compress.c    Tue Dec 22 16:04:20 1992
  716. --- ImageMagick2.2.3/compress.c    Wed Dec 23 18:10:02 1992
  717. ***************
  718. *** 1078,1084 ****
  719.         k=((int) (p->index) << (MaxLZWBits-8))+waiting_code;
  720.         if (k >= MaxHashTable)
  721.           k-=MaxHashTable;
  722. !       if (hash_code[k] != 0)
  723.           {
  724.             if ((hash_prefix[k] == waiting_code) &&
  725.                 (hash_suffix[k] == (unsigned char) (p->index & 0xff)))
  726. --- 1078,1084 ----
  727.         k=((int) (p->index) << (MaxLZWBits-8))+waiting_code;
  728.         if (k >= MaxHashTable)
  729.           k-=MaxHashTable;
  730. !       if (hash_code[k] >= 0)
  731.           {
  732.             if ((hash_prefix[k] == waiting_code) &&
  733.                 (hash_suffix[k] == (unsigned char) (p->index & 0xff)))
  734. diff -r -c ImageMagick/display.c ImageMagick2.2.3/display.c
  735. *** ImageMagick/display.c    Tue Dec 22 16:04:22 1992
  736. --- ImageMagick2.2.3/display.c    Wed Dec 23 18:10:03 1992
  737. ***************
  738. *** 625,633 ****
  739.         if (resource_info->number_colors > 0)
  740.           if ((output_image->class == DirectClass) ||
  741.               (output_image->colors > resource_info->number_colors))
  742. !           QuantizeImage(output_image,resource_info->number_colors,
  743. !             resource_info->tree_depth,resource_info->dither,
  744. !             resource_info->colorspace,True);
  745.         (void) strcpy(output_image->filename,filename);
  746.         if (command == 'p')
  747.           (void) PrintImage(output_image,resource_info->image_geometry);
  748. --- 625,636 ----
  749.         if (resource_info->number_colors > 0)
  750.           if ((output_image->class == DirectClass) ||
  751.               (output_image->colors > resource_info->number_colors))
  752. !           {
  753. !             QuantizeImage(output_image,resource_info->number_colors,
  754. !               resource_info->tree_depth,resource_info->dither,
  755. !               resource_info->colorspace,True);
  756. !             SyncImage(output_image);
  757. !           }
  758.         (void) strcpy(output_image->filename,filename);
  759.         if (command == 'p')
  760.           (void) PrintImage(output_image,resource_info->image_geometry);
  761. ***************
  762. *** 668,674 ****
  763.         break;
  764.       }
  765.     }
  766. !   if ((width > 0) && (height > 0))
  767.       {
  768.         unsigned int
  769.           mask;
  770. --- 671,677 ----
  771.         break;
  772.       }
  773.     }
  774. !   if ((width != 0) && (height != 0))
  775.       {
  776.         unsigned int
  777.           mask;
  778. ***************
  779. *** 2193,2199 ****
  780.         /*
  781.           Free previous resources on the root window.
  782.         */
  783. !       XKillClient(display,*((Pixmap *) data));
  784.         XFree((void *) data);
  785.       }
  786.     /*
  787. --- 2196,2202 ----
  788.         /*
  789.           Free previous resources on the root window.
  790.         */
  791. !       XKillClient(display,(XID) (*((Pixmap *) data)));
  792.         XFree((void *) data);
  793.       }
  794.     /*
  795. ***************
  796. *** 2926,2932 ****
  797.     *state&=(~NextImageState);
  798.     *state&=(~TileImageState);
  799.     if (resource_info->delay == 0)
  800. !     timeout=(~0);
  801.     else
  802.       timeout=(unsigned long) time((time_t *) 0)+resource_info->delay;
  803.     do
  804. --- 2929,2935 ----
  805.     *state&=(~NextImageState);
  806.     *state&=(~TileImageState);
  807.     if (resource_info->delay == 0)
  808. !     timeout=(unsigned long) (~0);
  809.     else
  810.       timeout=(unsigned long) time((time_t *) 0)+resource_info->delay;
  811.     do
  812. ***************
  813. *** 3179,3185 ****
  814.                   Reset timeout after expose.
  815.                 */
  816.                 if (resource_info->delay == 0)
  817. !                 timeout=(~0);
  818.                 else
  819.                   timeout=(unsigned long) time((time_t *) 0)+resource_info->delay;
  820.                 break;
  821. --- 3182,3188 ----
  822.                   Reset timeout after expose.
  823.                 */
  824.                 if (resource_info->delay == 0)
  825. !                 timeout=(unsigned long) (~0);
  826.                 else
  827.                   timeout=(unsigned long) time((time_t *) 0)+resource_info->delay;
  828.                 break;
  829. ***************
  830. *** 3513,3521 ****
  831.         if (resource_info->number_colors > 0)
  832.           if ((displayed_image->class == DirectClass) ||
  833.               (displayed_image->colors > resource_info->number_colors))
  834. !           QuantizeImage(displayed_image,resource_info->number_colors,
  835. !             resource_info->tree_depth,resource_info->dither,
  836. !             resource_info->colorspace,True);
  837.       }
  838.     /*
  839.       Free X resources.
  840. --- 3516,3527 ----
  841.         if (resource_info->number_colors > 0)
  842.           if ((displayed_image->class == DirectClass) ||
  843.               (displayed_image->colors > resource_info->number_colors))
  844. !           {
  845. !             QuantizeImage(displayed_image,resource_info->number_colors,
  846. !               resource_info->tree_depth,resource_info->dither,
  847. !               resource_info->colorspace,True);
  848. !             SyncImage(displayed_image);
  849. !           }
  850.       }
  851.     /*
  852.       Free X resources.
  853. ***************
  854. *** 4109,4115 ****
  855.                       p++;
  856.                       p_bit=0;
  857.                     }
  858. !                 if (q_bit > 0)
  859.                     *q=byte >> (8-q_bit);
  860.                   q+=scanline_pad;
  861.                 }
  862. --- 4115,4121 ----
  863.                       p++;
  864.                       p_bit=0;
  865.                     }
  866. !                 if (q_bit != 0)
  867.                     *q=byte >> (8-q_bit);
  868.                   q+=scanline_pad;
  869.                 }
  870. ***************
  871. *** 4166,4172 ****
  872.                       p++;
  873.                       p_bit=0;
  874.                     }
  875. !                 if (q_bit > 0)
  876.                     *q=byte << (8-q_bit);
  877.                   q+=scanline_pad;
  878.                 }
  879. --- 4172,4178 ----
  880.                       p++;
  881.                       p_bit=0;
  882.                     }
  883. !                 if (q_bit != 0)
  884.                     *q=byte << (8-q_bit);
  885.                   q+=scanline_pad;
  886.                 }
  887. ***************
  888. *** 5556,5561 ****
  889. --- 5562,5571 ----
  890.         }
  891.       else
  892.         {
  893. +         double
  894. +           normalized_maximum_error,
  895. +           normalized_mean_error;
  896.           Image
  897.             *image,
  898.             info_image,
  899. ***************
  900. *** 5564,5570 ****
  901.           time_t
  902.             start_time;
  903.   
  904. !         unsigned long
  905.             total_colors;
  906.   
  907.           /*
  908. --- 5574,5583 ----
  909.           time_t
  910.             start_time;
  911.   
  912. !         unsigned int
  913. !           mean_error_per_pixel;
  914. !         unsigned long int
  915.             total_colors;
  916.   
  917.           /*
  918. ***************
  919. *** 5581,5588 ****
  920.           do
  921.           {
  922.             info_image=(*image);
  923. !           if (scene > 0)
  924.               image->scene=scene;
  925.             /*
  926.               Transform image as defined by the clip, image and scale geometries.
  927.             */
  928. --- 5594,5602 ----
  929.           do
  930.           {
  931.             info_image=(*image);
  932. !           if (scene != 0)
  933.               image->scene=scene;
  934. +           total_colors=0;
  935.             /*
  936.               Transform image as defined by the clip, image and scale geometries.
  937.             */
  938. ***************
  939. *** 5654,5678 ****
  940.               InverseImage(image);
  941.             if (normalize)
  942.               NormalizeImage(image);
  943. -           if (verbose)
  944. -             {
  945. -               /*
  946. -                 Initialize image error attributes.
  947. -               */
  948. -               if (image->class == DirectClass)
  949. -                 image->colors=NumberColors(image,(FILE *) NULL);
  950. -               total_colors=image->colors;
  951. -             }
  952.             if (resource_info.colorspace == GRAYColorspace)
  953.               QuantizeImage(image,256,8,resource_info.dither,GRAYColorspace,True);
  954.             if (resource_info.monochrome)
  955.               QuantizeImage(image,2,8,resource_info.dither,GRAYColorspace,True);
  956. !           if (resource_info.number_colors > 0)
  957.               if ((image->class == DirectClass) ||
  958.                   (image->colors > resource_info.number_colors))
  959. !               QuantizeImage(image,resource_info.number_colors,
  960. !                 resource_info.tree_depth,resource_info.dither,
  961. !                 resource_info.colorspace,True);
  962.             /*
  963.               Display image to X server.
  964.             */
  965. --- 5668,5698 ----
  966.               InverseImage(image);
  967.             if (normalize)
  968.               NormalizeImage(image);
  969.             if (resource_info.colorspace == GRAYColorspace)
  970.               QuantizeImage(image,256,8,resource_info.dither,GRAYColorspace,True);
  971.             if (resource_info.monochrome)
  972.               QuantizeImage(image,2,8,resource_info.dither,GRAYColorspace,True);
  973. !           if (resource_info.number_colors != 0)
  974.               if ((image->class == DirectClass) ||
  975.                   (image->colors > resource_info.number_colors))
  976. !               {
  977. !                 /*
  978. !                   Reduce the number of colors in the image.
  979. !                 */
  980. !                 QuantizeImage(image,resource_info.number_colors,
  981. !                   resource_info.tree_depth,resource_info.dither,
  982. !                   resource_info.colorspace,True);
  983. !                 if (verbose)
  984. !                   {
  985. !                     /*
  986. !                       Measure quantization error.
  987. !                     */
  988. !                     QuantizationError(image,&mean_error_per_pixel,
  989. !                       &normalized_mean_error,&normalized_maximum_error);
  990. !                     total_colors=NumberColors(image,(FILE *) NULL);
  991. !                   }
  992. !                 SyncImage(image);
  993. !               }
  994.             /*
  995.               Display image to X server.
  996.             */
  997. ***************
  998. *** 5744,5766 ****
  999.                   (void) fprintf(stderr," DirectClass ");
  1000.                 else
  1001.                   (void) fprintf(stderr," PseudoClass ");
  1002. !               if (total_colors != image->colors)
  1003. !                 (void) fprintf(stderr,"%lu=>",total_colors);
  1004. !               (void) fprintf(stderr,"%uc",image->colors);
  1005. !               if ((resource_info.number_colors > 0) || resource_info.monochrome)
  1006.                   {
  1007. !                   double
  1008. !                     normalized_maximum_error,
  1009. !                     normalized_mean_error;
  1010. !                   unsigned int
  1011. !                     mean_error_per_pixel;
  1012. !                   /*
  1013. !                     Measure quantization error.
  1014. !                   */
  1015. !                   QuantizationError(image,&mean_error_per_pixel,
  1016. !                     &normalized_mean_error,&normalized_maximum_error);
  1017.                     (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  1018.                       normalized_mean_error,normalized_maximum_error);
  1019.                   }
  1020. --- 5764,5774 ----
  1021.                   (void) fprintf(stderr," DirectClass ");
  1022.                 else
  1023.                   (void) fprintf(stderr," PseudoClass ");
  1024. !               if (total_colors == 0)
  1025. !                 (void) fprintf(stderr,"%uc",image->colors);
  1026. !               else
  1027.                   {
  1028. !                   (void) fprintf(stderr,"%lu=>%uc",total_colors,image->colors);
  1029.                     (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  1030.                       normalized_mean_error,normalized_maximum_error);
  1031.                   }
  1032. ***************
  1033. *** 5791,5797 ****
  1034.               for (i--; i > 0; i--)
  1035.                 if (image_marker[i] == (image_number-2))
  1036.                   break;
  1037. !             if (image_number > 0)
  1038.                 image_number--;
  1039.             }
  1040.         }
  1041. --- 5799,5805 ----
  1042.               for (i--; i > 0; i--)
  1043.                 if (image_marker[i] == (image_number-2))
  1044.                   break;
  1045. !             if (image_number != 0)
  1046.                 image_number--;
  1047.             }
  1048.         }
  1049. diff -r -c ImageMagick/display.h ImageMagick2.2.3/display.h
  1050. *** ImageMagick/display.h    Tue Dec 22 16:23:32 1992
  1051. --- ImageMagick2.2.3/display.h    Wed Dec 23 18:10:04 1992
  1052. ***************
  1053. *** 51,55 ****
  1054.   */
  1055.   #ifndef lint
  1056.   static char 
  1057. !   Version[]="@(#)ImageMagick 2.2.2 92/12/22 cristy@dupont.com";
  1058.   #endif
  1059. --- 51,55 ----
  1060.   */
  1061.   #ifndef lint
  1062.   static char 
  1063. !   Version[]="@(#)ImageMagick 2.2.3 93/01/01 cristy@dupont.com";
  1064.   #endif
  1065. diff -r -c ImageMagick/image.c ImageMagick2.2.3/image.c
  1066. *** ImageMagick/image.c    Tue Dec 22 16:06:19 1992
  1067. --- ImageMagick2.2.3/image.c    Wed Dec 23 18:10:03 1992
  1068. ***************
  1069. *** 62,67 ****
  1070. --- 62,73 ----
  1071.     *client_name;
  1072.   
  1073.   /*
  1074. +   Forward declarations.
  1075. + */
  1076. + static Image
  1077. +   *ZoomImage _Declare((Image *));
  1078. + /*
  1079.   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1080.   %                                                                             %
  1081.   %                                                                             %
  1082. ***************
  1083. *** 1597,1605 ****
  1084.       }
  1085.       case PseudoClass:
  1086.       {
  1087. -       register unsigned short
  1088. -         index;
  1089.         /*
  1090.           Gamma-correct PseudoClass image.
  1091.         */
  1092. --- 1603,1608 ----
  1093. ***************
  1094. *** 1609,1623 ****
  1095.           image->colormap[i].green=gamma_map[image->colormap[i].green];
  1096.           image->colormap[i].blue=gamma_map[image->colormap[i].blue];
  1097.         }
  1098. !       p=image->pixels;
  1099. !       for (i=0; i < image->packets; i++)
  1100. !       {
  1101. !         index=p->index;
  1102. !         p->red=image->colormap[index].red;
  1103. !         p->green=image->colormap[index].green;
  1104. !         p->blue=image->colormap[index].blue;
  1105. !         p++;
  1106. !       }
  1107.         break;
  1108.       }
  1109.     }
  1110. --- 1612,1618 ----
  1111.           image->colormap[i].green=gamma_map[image->colormap[i].green];
  1112.           image->colormap[i].blue=gamma_map[image->colormap[i].blue];
  1113.         }
  1114. !       SyncImage(image);
  1115.         break;
  1116.       }
  1117.     }
  1118. ***************
  1119. *** 1675,1683 ****
  1120.       }
  1121.       case PseudoClass:
  1122.       {
  1123. -       register unsigned short
  1124. -         index;
  1125.         /*
  1126.           Inverse PseudoClass packets.
  1127.         */
  1128. --- 1670,1675 ----
  1129. ***************
  1130. *** 1687,1701 ****
  1131.           image->colormap[i].green=(~image->colormap[i].green);
  1132.           image->colormap[i].blue=(~image->colormap[i].blue);
  1133.         }
  1134. !       p=image->pixels;
  1135. !       for (i=0; i < image->packets; i++)
  1136. !       {
  1137. !         index=p->index;
  1138. !         p->red=image->colormap[index].red;
  1139. !         p->green=image->colormap[index].green;
  1140. !         p->blue=image->colormap[index].blue;
  1141. !         p++;
  1142. !       }
  1143.         break;
  1144.       }
  1145.     }
  1146. --- 1679,1685 ----
  1147.           image->colormap[i].green=(~image->colormap[i].green);
  1148.           image->colormap[i].blue=(~image->colormap[i].blue);
  1149.         }
  1150. !       SyncImage(image);
  1151.         break;
  1152.       }
  1153.     }
  1154. ***************
  1155. *** 2032,2038 ****
  1156.         break;
  1157.     }
  1158.     intensity=0;
  1159. !   for (high=MaxRGB; high > 0; high--)
  1160.     {
  1161.       intensity+=histogram[high];
  1162.       if (intensity > threshold_intensity)
  1163. --- 2016,2022 ----
  1164.         break;
  1165.     }
  1166.     intensity=0;
  1167. !   for (high=MaxRGB; high != 0; high--)
  1168.     {
  1169.       intensity+=histogram[high];
  1170.       if (intensity > threshold_intensity)
  1171. ***************
  1172. *** 2052,2058 ****
  1173.             break;
  1174.         }
  1175.         intensity=0;
  1176. !       for (high=MaxRGB; high > 0; high--)
  1177.         {
  1178.           intensity+=histogram[high];
  1179.           if (intensity > threshold_intensity)
  1180. --- 2036,2042 ----
  1181.             break;
  1182.         }
  1183.         intensity=0;
  1184. !       for (high=MaxRGB; high != 0; high--)
  1185.         {
  1186.           intensity+=histogram[high];
  1187.           if (intensity > threshold_intensity)
  1188. ***************
  1189. *** 2094,2102 ****
  1190.       }
  1191.       case PseudoClass:
  1192.       {
  1193. -       register unsigned short
  1194. -         index;
  1195.         /*
  1196.           Normalize PseudoClass image.
  1197.         */
  1198. --- 2078,2083 ----
  1199. ***************
  1200. *** 2106,2120 ****
  1201.           image->colormap[i].green=normalize_map[image->colormap[i].green];
  1202.           image->colormap[i].blue=normalize_map[image->colormap[i].blue];
  1203.         }
  1204. !       p=image->pixels;
  1205. !       for (i=0; i < image->packets; i++)
  1206. !       {
  1207. !         index=p->index;
  1208. !         p->red=image->colormap[index].red;
  1209. !         p->green=image->colormap[index].green;
  1210. !         p->blue=image->colormap[index].blue;
  1211. !         p++;
  1212. !       }
  1213.         break;
  1214.       }
  1215.     }
  1216. --- 2087,2093 ----
  1217.           image->colormap[i].green=normalize_map[image->colormap[i].green];
  1218.           image->colormap[i].blue=normalize_map[image->colormap[i].blue];
  1219.         }
  1220. !       SyncImage(image);
  1221.         break;
  1222.       }
  1223.     }
  1224. ***************
  1225. *** 3502,3508 ****
  1226.   %
  1227.   %
  1228.   */
  1229. ! Image *ReduceImage(image)
  1230.   Image
  1231.     *image;
  1232.   {
  1233. --- 3475,3481 ----
  1234.   %
  1235.   %
  1236.   */
  1237. ! static Image *ReduceImage(image)
  1238.   Image
  1239.     *image;
  1240.   {
  1241. ***************
  1242. *** 4005,4013 ****
  1243.       }
  1244.       case PseudoClass:
  1245.       {
  1246. -       register unsigned short
  1247. -         index;
  1248.         /*
  1249.           Convert PseudoClass image.
  1250.         */
  1251. --- 3978,3983 ----
  1252. ***************
  1253. *** 4023,4037 ****
  1254.           image->colormap[i].blue=
  1255.             range_limit[DownShift(x[red+Z]+y[green+Z]+z[blue+Z]+tz)];
  1256.         }
  1257. !       p=image->pixels;
  1258. !       for (i=0; i < image->packets; i++)
  1259. !       {
  1260. !         index=p->index;
  1261. !         p->red=image->colormap[index].red;
  1262. !         p->green=image->colormap[index].green;
  1263. !         p->blue=image->colormap[index].blue;
  1264. !         p++;
  1265. !       }
  1266.         break;
  1267.       }
  1268.     }
  1269. --- 3993,3999 ----
  1270.           image->colormap[i].blue=
  1271.             range_limit[DownShift(x[red+Z]+y[green+Z]+z[blue+Z]+tz)];
  1272.         }
  1273. !       SyncImage(image);
  1274.         break;
  1275.       }
  1276.     }
  1277. ***************
  1278. *** 4082,4088 ****
  1279.   Image
  1280.     *image;
  1281.   
  1282. ! unsigned int
  1283.     x_offset,
  1284.     y_offset;
  1285.   {
  1286. --- 4044,4050 ----
  1287.   Image
  1288.     *image;
  1289.   
  1290. ! int
  1291.     x_offset,
  1292.     y_offset;
  1293.   {
  1294. ***************
  1295. *** 4540,4545 ****
  1296. --- 4502,4554 ----
  1297.     return(stereo_image);
  1298.   }
  1299.   
  1300. + /*
  1301. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1302. + %                                                                             %
  1303. + %                                                                             %
  1304. + %                                                                             %
  1305. + %   S y n c I m a g e                                                         %
  1306. + %                                                                             %
  1307. + %                                                                             %
  1308. + %                                                                             %
  1309. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1310. + %
  1311. + %  Function SyncImage initializes the red, green, and blue intensities of each
  1312. + %  pixel as defined by the colormap index.
  1313. + %
  1314. + %  The format of the SyncImage routine is:
  1315. + %
  1316. + %      SyncImage(image)
  1317. + %
  1318. + %  A description of each parameter follows:
  1319. + %
  1320. + %    o image: The address of a structure of type Image.
  1321. + %
  1322. + %
  1323. + */
  1324. + void SyncImage(image)
  1325. + Image
  1326. +   *image;
  1327. + {
  1328. +   register int
  1329. +     i;
  1330. +   register RunlengthPacket
  1331. +     *p;
  1332. +   register unsigned short
  1333. +     index;
  1334. +   p=image->pixels;
  1335. +   for (i=0; i < image->packets; i++)
  1336. +   {
  1337. +     index=p->index;
  1338. +     p->red=image->colormap[index].red;
  1339. +     p->green=image->colormap[index].green;
  1340. +     p->blue=image->colormap[index].blue;
  1341. +     p++;
  1342. +   }
  1343. + }
  1344.   
  1345.   /*
  1346.   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1347. ***************
  1348. *** 5430,5436 ****
  1349.   %
  1350.   %
  1351.   */
  1352. ! Image *ZoomImage(image)
  1353.   Image
  1354.     *image;
  1355.   {
  1356. --- 5439,5445 ----
  1357.   %
  1358.   %
  1359.   */
  1360. ! static Image *ZoomImage(image)
  1361.   Image
  1362.     *image;
  1363.   {
  1364. diff -r -c ImageMagick/image.h ImageMagick2.2.3/image.h
  1365. *** ImageMagick/image.h    Tue Dec 22 16:04:24 1992
  1366. --- ImageMagick2.2.3/image.h    Wed Dec 23 18:33:18 1992
  1367. ***************
  1368. *** 146,159 ****
  1369.     *EnhanceImage _Declare((Image *)),
  1370.     *NoisyImage _Declare((Image *)),
  1371.     *ReadImage _Declare((char *)),
  1372. -   *ReduceImage _Declare((Image *)),
  1373.     *ReflectImage _Declare((Image *)),
  1374. !   *RollImage _Declare((Image *,unsigned int,unsigned int)),
  1375. !   *RotateImage _Declare((Image *,double,int)),
  1376.     *ScaleImage _Declare((Image *,unsigned int,unsigned int)),
  1377.     *ShearImage _Declare((Image *,double,double,unsigned int)),
  1378. !   *StereoImage _Declare((Image *,Image *)),
  1379. !   *ZoomImage _Declare((Image *));
  1380.   
  1381.   extern int
  1382.     ReadDataBlock _Declare((char *,FILE *));
  1383. --- 146,157 ----
  1384.     *EnhanceImage _Declare((Image *)),
  1385.     *NoisyImage _Declare((Image *)),
  1386.     *ReadImage _Declare((char *)),
  1387.     *ReflectImage _Declare((Image *)),
  1388. !   *RollImage _Declare((Image *,int,int)),
  1389. !   *RotateImage _Declare((Image *,double,unsigned int)),
  1390.     *ScaleImage _Declare((Image *,unsigned int,unsigned int)),
  1391.     *ShearImage _Declare((Image *,double,double,unsigned int)),
  1392. !   *StereoImage _Declare((Image *,Image *));
  1393.   
  1394.   extern int
  1395.     ReadDataBlock _Declare((char *,FILE *));
  1396. ***************
  1397. *** 186,190 ****
  1398. --- 184,189 ----
  1399.       unsigned int,unsigned int,unsigned int,unsigned int)),
  1400.     RGBTransformImage _Declare((Image *,unsigned int)),
  1401.     SortColormapByIntensity _Declare((Image *)),
  1402. +   SyncImage _Declare((Image *)),
  1403.     TransformImage _Declare((Image **,char *,char *,char *)),
  1404.     TransformRGBImage _Declare((Image *,unsigned int));
  1405. Common subdirectories: ImageMagick/images and ImageMagick2.2.3/images
  1406. diff -r -c ImageMagick/import.c ImageMagick2.2.3/import.c
  1407. *** ImageMagick/import.c    Tue Dec 22 16:04:24 1992
  1408. --- ImageMagick2.2.3/import.c    Wed Dec 23 18:10:03 1992
  1409. ***************
  1410. *** 433,439 ****
  1411.     /*
  1412.       Read image from X server.
  1413.     */
  1414. !   if (resource_info.delay > 0)
  1415.       (void) sleep(resource_info.delay);
  1416.     start_time=time((time_t *) 0);
  1417.     image=ReadXImage(target_window,server_name,frame,screen,borders);
  1418. --- 433,439 ----
  1419.     /*
  1420.       Read image from X server.
  1421.     */
  1422. !   if (resource_info.delay != 0)
  1423.       (void) sleep(resource_info.delay);
  1424.     start_time=time((time_t *) 0);
  1425.     image=ReadXImage(target_window,server_name,frame,screen,borders);
  1426. ***************
  1427. *** 459,465 ****
  1428.           (void) fprintf(stderr," DirectClass ");
  1429.         else
  1430.           (void) fprintf(stderr," PseudoClass ");
  1431. !       (void) fprintf(stderr,"%dc %s %ds\n",image->colors,image->magick,
  1432.           time((time_t *) 0)-start_time+1);
  1433.       }
  1434.     DestroyImage(image);
  1435. --- 459,465 ----
  1436.           (void) fprintf(stderr," DirectClass ");
  1437.         else
  1438.           (void) fprintf(stderr," PseudoClass ");
  1439. !       (void) fprintf(stderr,"%dc %s %lds\n",image->colors,image->magick,
  1440.           time((time_t *) 0)-start_time+1);
  1441.       }
  1442.     DestroyImage(image);
  1443. diff -r -c ImageMagick/montage.c ImageMagick2.2.3/montage.c
  1444. *** ImageMagick/montage.c    Tue Dec 22 16:04:25 1992
  1445. --- ImageMagick2.2.3/montage.c    Wed Dec 23 18:10:04 1992
  1446. ***************
  1447. *** 249,255 ****
  1448.       tile_border_height,
  1449.       tile_border_width,
  1450.       x,
  1451. !     y;
  1452.   
  1453.     register char
  1454.       *q;
  1455. --- 249,257 ----
  1456.       tile_border_height,
  1457.       tile_border_width,
  1458.       x,
  1459. !     x_offset,
  1460. !     y,
  1461. !     y_offset;
  1462.   
  1463.     register char
  1464.       *q;
  1465. ***************
  1466. *** 266,274 ****
  1467.       status,
  1468.       tile,
  1469.       tile_height,
  1470. !     tile_width,
  1471. !     x_offset,
  1472. !     y_offset;
  1473.   
  1474.     XAnnotateInfo
  1475.       annotate_info;
  1476. --- 268,274 ----
  1477.       status,
  1478.       tile,
  1479.       tile_height,
  1480. !     tile_width;
  1481.   
  1482.     XAnnotateInfo
  1483.       annotate_info;
  1484. ***************
  1485. *** 488,494 ****
  1486.       status=UnpackImage(image);
  1487.       if (status == False)
  1488.         Error("unable to unpack image",(char *) NULL);
  1489. !     if (border_width > 0)
  1490.         {
  1491.           Image
  1492.             *bordered_image;
  1493. --- 488,494 ----
  1494.       status=UnpackImage(image);
  1495.       if (status == False)
  1496.         Error("unable to unpack image",(char *) NULL);
  1497. !     if (border_width != 0)
  1498.         {
  1499.           Image
  1500.             *bordered_image;
  1501. ***************
  1502. *** 1396,1408 ****
  1503.       QuantizeImage(montage_image,256,8,resource_info.dither,GRAYColorspace,True);
  1504.     if (resource_info.monochrome)
  1505.       QuantizeImage(montage_image,2,8,resource_info.dither,GRAYColorspace,True);
  1506. !   if (resource_info.number_colors > 0)
  1507. !     QuantizeImage(montage_image,resource_info.number_colors,
  1508. !       resource_info.tree_depth,resource_info.dither,resource_info.colorspace,
  1509. !       True);
  1510.     if (compression != UndefinedCompression)
  1511.       montage_image->compression=compression;
  1512. !   strcpy(montage_image->filename,write_filename);
  1513.     (void) WriteAlienImage(montage_image);
  1514.     if (verbose)
  1515.       {
  1516. --- 1396,1411 ----
  1517.       QuantizeImage(montage_image,256,8,resource_info.dither,GRAYColorspace,True);
  1518.     if (resource_info.monochrome)
  1519.       QuantizeImage(montage_image,2,8,resource_info.dither,GRAYColorspace,True);
  1520. !   if (resource_info.number_colors != 0)
  1521. !     {
  1522. !       QuantizeImage(montage_image,resource_info.number_colors,
  1523. !         resource_info.tree_depth,resource_info.dither,resource_info.colorspace,
  1524. !         True);
  1525. !       SyncImage(montage_image);
  1526. !     }
  1527.     if (compression != UndefinedCompression)
  1528.       montage_image->compression=compression;
  1529. !   (void) strcpy(montage_image->filename,write_filename);
  1530.     (void) WriteAlienImage(montage_image);
  1531.     if (verbose)
  1532.       {
  1533. diff -r -c ImageMagick/quantize.c ImageMagick2.2.3/quantize.c
  1534. *** ImageMagick/quantize.c    Tue Dec 22 16:06:18 1992
  1535. --- ImageMagick2.2.3/quantize.c    Wed Dec 23 18:10:04 1992
  1536. ***************
  1537. *** 430,436 ****
  1538.           cube.color.red=p->red;
  1539.           cube.color.green=p->green;
  1540.           cube.color.blue=p->blue;
  1541. !         cube.distance=(~0);
  1542.           ClosestColor(node->parent);
  1543.           p->index=cube.color_number;
  1544.           p++;
  1545. --- 430,436 ----
  1546.           cube.color.red=p->red;
  1547.           cube.color.green=p->green;
  1548.           cube.color.blue=p->blue;
  1549. !         cube.distance=(unsigned long int) (~0);
  1550.           ClosestColor(node->parent);
  1551.           p->index=cube.color_number;
  1552.           p++;
  1553. ***************
  1554. *** 900,906 ****
  1555.             cube.color.red=red;
  1556.             cube.color.green=green;
  1557.             cube.color.blue=blue;
  1558. !           cube.distance=(~0);
  1559.             ClosestColor(node->parent);
  1560.             cache[i]=cube.color_number;
  1561.           }
  1562. --- 900,906 ----
  1563.             cube.color.red=red;
  1564.             cube.color.green=green;
  1565.             cube.color.blue=blue;
  1566. !           cube.distance=(unsigned long int) (~0);
  1567.             ClosestColor(node->parent);
  1568.             cache[i]=cube.color_number;
  1569.           }
  1570. ***************
  1571. *** 1020,1026 ****
  1572.     /*
  1573.       Initialize the shift values.
  1574.     */
  1575. !   for (max_shift=0; number_pixels > 0; max_shift++)
  1576.       number_pixels<<=1;
  1577.     for (level=0; level < cube.depth; level++)
  1578.     {
  1579. --- 1020,1026 ----
  1580.     /*
  1581.       Initialize the shift values.
  1582.     */
  1583. !   for (max_shift=0; number_pixels != 0; max_shift++)
  1584.       number_pixels<<=1;
  1585.     for (level=0; level < cube.depth; level++)
  1586.     {
  1587. ***************
  1588. *** 1044,1050 ****
  1589.         exit(1);
  1590.       }
  1591.     cube.root->parent=cube.root;
  1592. !   cube.root->number_colors=(~0);
  1593.     cube.colors=0;
  1594.   }
  1595.   
  1596. --- 1044,1050 ----
  1597.         exit(1);
  1598.       }
  1599.     cube.root->parent=cube.root;
  1600. !   cube.root->number_colors=(unsigned long int) (~0);
  1601.     cube.colors=0;
  1602.   }
  1603.   
  1604. ***************
  1605. *** 1552,1558 ****
  1606.       RGBTransformImage(image,colorspace);
  1607.     Classification(image);
  1608.     if (!optimal)
  1609. !     dither|=cube.colors > (1 << (cube.depth-1));
  1610.     Reduction(number_colors);
  1611.     Assignment(image,dither,optimal);
  1612.     if (colorspace != RGBColorspace)
  1613. --- 1552,1558 ----
  1614.       RGBTransformImage(image,colorspace);
  1615.     Classification(image);
  1616.     if (!optimal)
  1617. !     dither|=(cube.colors > (1 << (cube.depth-1)));
  1618.     Reduction(number_colors);
  1619.     Assignment(image,dither,optimal);
  1620.     if (colorspace != RGBColorspace)
  1621. ***************
  1622. *** 1689,1695 ****
  1623.         Classification(images[i]);
  1624.     }
  1625.     if (!optimal)
  1626. !     dither|=cube.colors > (1 << (cube.depth-1));
  1627.     Reduction(number_colors);
  1628.     for (i=0; i < number_images; i++)
  1629.     {
  1630. --- 1689,1695 ----
  1631.         Classification(images[i]);
  1632.     }
  1633.     if (!optimal)
  1634. !     dither|=(cube.colors > (1 << (cube.depth-1)));
  1635.     Reduction(number_colors);
  1636.     for (i=0; i < number_images; i++)
  1637.     {
  1638. Only in ImageMagick2.2.3: rotate.c
  1639. Common subdirectories: ImageMagick/scenes and ImageMagick2.2.3/scenes
  1640. diff -r -c ImageMagick/shear.c ImageMagick2.2.3/shear.c
  1641. *** ImageMagick/shear.c    Tue Dec 22 16:04:26 1992
  1642. --- ImageMagick2.2.3/shear.c    Wed Dec 23 21:12:31 1992
  1643. ***************
  1644. *** 940,946 ****
  1645.   double
  1646.     degrees;
  1647.   
  1648. ! int
  1649.     clip;
  1650.   {
  1651.     ColorPacket
  1652. --- 940,946 ----
  1653.   double
  1654.     degrees;
  1655.   
  1656. ! unsigned int
  1657.     clip;
  1658.   {
  1659.     ColorPacket
  1660. ***************
  1661. *** 1038,1044 ****
  1662.     background.red=image->pixels[0].red;
  1663.     background.green=image->pixels[0].green;
  1664.     background.blue=image->pixels[0].blue;
  1665. !   rotated_image=BorderImage(integral_image,x_offset,y_offset+1,background);
  1666.     DestroyImage(integral_image);
  1667.     if (rotated_image == (Image *) NULL)
  1668.       {
  1669. --- 1038,1045 ----
  1670.     background.red=image->pixels[0].red;
  1671.     background.green=image->pixels[0].green;
  1672.     background.blue=image->pixels[0].blue;
  1673. !   rotated_image=BorderImage(integral_image,(unsigned int) x_offset,
  1674. !     (unsigned int) y_offset+1,background);
  1675.     DestroyImage(integral_image);
  1676.     if (rotated_image == (Image *) NULL)
  1677.       {
  1678. ***************
  1679. *** 1187,1193 ****
  1680.     background.red=image->pixels[0].red;
  1681.     background.green=image->pixels[0].green;
  1682.     background.blue=image->pixels[0].blue;
  1683. !   sheared_image=BorderImage(image,x_offset,y_offset+1,background);
  1684.     if (sheared_image == (Image *) NULL)
  1685.       {
  1686.         Warning("unable to rotate image","memory allocation failed");
  1687. --- 1188,1195 ----
  1688.     background.red=image->pixels[0].red;
  1689.     background.green=image->pixels[0].green;
  1690.     background.blue=image->pixels[0].blue;
  1691. !   sheared_image=BorderImage(image,(unsigned int) x_offset,
  1692. !     (unsigned int) y_offset+1,background);
  1693.     if (sheared_image == (Image *) NULL)
  1694.       {
  1695.         Warning("unable to rotate image","memory allocation failed");
  1696. diff -r -c ImageMagick/signature.c ImageMagick2.2.3/signature.c
  1697. *** ImageMagick/signature.c    Tue Dec 22 16:04:27 1992
  1698. --- ImageMagick2.2.3/signature.c    Wed Dec 23 18:10:04 1992
  1699. ***************
  1700. *** 244,265 ****
  1701.     static unsigned long int
  1702.       additive_constant[64]=  /* 4294967296*abs(sin(i)), i in radians */
  1703.       {
  1704. !       3614090360L, 3905402710L,  606105819L, 3250441966L,
  1705. !       4118548399L, 1200080426L, 2821735955L, 4249261313L,
  1706. !       1770035416L, 2336552879L, 4294925233L, 2304563134L,
  1707. !       1804603682L, 4254626195L, 2792965006L, 1236535329L,
  1708. !       4129170786L, 3225465664L,  643717713L, 3921069994L,
  1709. !       3593408605L,   38016083L, 3634488961L, 3889429448L,
  1710. !        568446438L, 3275163606L, 4107603335L, 1163531501L,
  1711. !       2850285829L, 4243563512L, 1735328473L, 2368359562L,
  1712. !       4294588738L, 2272392833L, 1839030562L, 4259657740L,
  1713. !       2763975236L, 1272893353L, 4139469664L, 3200236656L,
  1714. !        681279174L, 3936430074L, 3572445317L,   76029189L,
  1715. !       3654602809L, 3873151461L,  530742520L, 3299628645L,
  1716. !       4096336452L, 1126891415L, 2878612391L, 4237533241L,
  1717. !       1700485571L, 2399980690L, 4293915773L, 2240044497L,
  1718. !       1873313359L, 4264355552L, 2734768916L, 1309151649L,
  1719. !       4149444226L, 3173756917L,  718787259L, 3951481745L
  1720.       };
  1721.   
  1722.     register int
  1723. --- 244,262 ----
  1724.     static unsigned long int
  1725.       additive_constant[64]=  /* 4294967296*abs(sin(i)), i in radians */
  1726.       {
  1727. !       0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf,
  1728. !       0x4787c62a, 0xa8304613, 0xfd469501, 0x698098d8, 0x8b44f7af,
  1729. !       0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e,
  1730. !       0x49b40821, 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa,
  1731. !       0xd62f105d, 0x2441453,  0xd8a1e681, 0xe7d3fbc8, 0x21e1cde6,
  1732. !       0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8,
  1733. !       0x676f02d9, 0x8d2a4c8a, 0xfffa3942, 0x8771f681, 0x6d9d6122,
  1734. !       0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,
  1735. !       0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x4881d05,  0xd9d4d039,
  1736. !       0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, 0xf4292244, 0x432aff97,
  1737. !       0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d,
  1738. !       0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,
  1739. !       0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391,
  1740.       };
  1741.   
  1742.     register int
  1743. Common subdirectories: ImageMagick/utilities and ImageMagick2.2.3/utilities
  1744. Common subdirectories: ImageMagick/xtp and ImageMagick2.2.3/xtp
  1745. diff -r -c ImageMagick/utilities/MIFFtoSTEREO.c ImageMagick2.2.3/utilities/MIFFtoSTEREO.c
  1746. *** ImageMagick/utilities/MIFFtoSTEREO.c    Tue Dec 22 16:05:22 1992
  1747. --- ImageMagick2.2.3/utilities/MIFFtoSTEREO.c    Wed Dec 23 18:10:10 1992
  1748. ***************
  1749. *** 200,206 ****
  1750.       (void) fprintf(stderr," DirectClass ");
  1751.     else
  1752.       (void) fprintf(stderr," PseudoClass ");
  1753. !   (void) fprintf(stderr,"%dc %s %ds\n",stereo_image->colors,
  1754.       stereo_image->magick,time((time_t *) 0)-start_time+1);
  1755.     return(!status);
  1756.   }
  1757. --- 200,206 ----
  1758.       (void) fprintf(stderr," DirectClass ");
  1759.     else
  1760.       (void) fprintf(stderr," PseudoClass ");
  1761. !   (void) fprintf(stderr,"%dc %s %lds\n",stereo_image->colors,
  1762.       stereo_image->magick,time((time_t *) 0)-start_time+1);
  1763.     return(!status);
  1764.   }
  1765. diff -r -c ImageMagick/utilities/convert.c ImageMagick2.2.3/utilities/convert.c
  1766. *** ImageMagick/utilities/convert.c    Tue Dec 22 16:05:23 1992
  1767. --- ImageMagick2.2.3/utilities/convert.c    Wed Dec 23 18:10:10 1992
  1768. ***************
  1769. *** 203,209 ****
  1770.   char
  1771.     *argv[];
  1772.   {
  1773. ! #define NotInitialized  (~0)
  1774.   
  1775.     AlienInfo
  1776.       alien_info;
  1777. --- 203,209 ----
  1778.   char
  1779.     *argv[];
  1780.   {
  1781. ! #define NotInitialized  (unsigned int) (~0)
  1782.   
  1783.     AlienInfo
  1784.       alien_info;
  1785. ***************
  1786. *** 212,217 ****
  1787. --- 212,221 ----
  1788.       *filename,
  1789.       *option;
  1790.   
  1791. +   double
  1792. +     normalized_maximum_error,
  1793. +     normalized_mean_error;
  1794.     Image
  1795.       *image,
  1796.       *next_image;
  1797. ***************
  1798. *** 229,241 ****
  1799.       colorspace,
  1800.       compression,
  1801.       dither,
  1802.       number_colors,
  1803.       quality,
  1804.       scene,
  1805. -     total_colors,
  1806.       tree_depth,
  1807.       verbose;
  1808.   
  1809.     /*
  1810.       Initialize program variables.
  1811.     */
  1812. --- 233,248 ----
  1813.       colorspace,
  1814.       compression,
  1815.       dither,
  1816. +     mean_error_per_pixel,
  1817.       number_colors,
  1818.       quality,
  1819.       scene,
  1820.       tree_depth,
  1821.       verbose;
  1822.   
  1823. +   unsigned long int
  1824. +     total_colors;
  1825.     /*
  1826.       Initialize program variables.
  1827.     */
  1828. ***************
  1829. *** 453,483 ****
  1830.     */
  1831.     do
  1832.     {
  1833.       if (alpha != NotInitialized)
  1834.         image->alpha=alpha;
  1835.       if (compression != UndefinedCompression)
  1836.         image->compression=compression;
  1837. !     if (quality > 0)
  1838.         image->quality=quality;
  1839. !     if (scene > 0)
  1840.         image->scene=scene;
  1841.       (void) strcpy(image->filename,argv[i]);
  1842.       if (image->last != (Image *) NULL)
  1843.         (void) sprintf(image->filename,"%s.%u\0",argv[i],image->scene);
  1844. -     if (verbose)
  1845. -       {
  1846. -         /*
  1847. -           Initialize image error attributes.
  1848. -         */
  1849. -         if (image->class == DirectClass)
  1850. -           image->colors=NumberColors(image,(FILE *) NULL);
  1851. -         total_colors=image->colors;
  1852. -       }
  1853.       if (colorspace == GRAYColorspace)
  1854.         QuantizeImage(image,256,8,dither,GRAYColorspace,True);
  1855. !     if (number_colors > 0)
  1856.         if ((image->class == DirectClass) || (image->colors > number_colors))
  1857. !         QuantizeImage(image,number_colors,tree_depth,dither,colorspace,True);
  1858.       status=WriteAlienImage(image);
  1859.       if (verbose)
  1860.         {
  1861. --- 460,497 ----
  1862.     */
  1863.     do
  1864.     {
  1865. +     total_colors=0;
  1866.       if (alpha != NotInitialized)
  1867.         image->alpha=alpha;
  1868.       if (compression != UndefinedCompression)
  1869.         image->compression=compression;
  1870. !     if (quality != 0)
  1871.         image->quality=quality;
  1872. !     if (scene != 0)
  1873.         image->scene=scene;
  1874.       (void) strcpy(image->filename,argv[i]);
  1875.       if (image->last != (Image *) NULL)
  1876.         (void) sprintf(image->filename,"%s.%u\0",argv[i],image->scene);
  1877.       if (colorspace == GRAYColorspace)
  1878.         QuantizeImage(image,256,8,dither,GRAYColorspace,True);
  1879. !     if (number_colors != 0)
  1880.         if ((image->class == DirectClass) || (image->colors > number_colors))
  1881. !         {
  1882. !           /*
  1883. !             Reduce the number of colors in the image.
  1884. !           */
  1885. !           QuantizeImage(image,number_colors,tree_depth,dither,colorspace,True);
  1886. !           if (verbose)
  1887. !             {
  1888. !               /*
  1889. !                 Measure quantization error.
  1890. !               */
  1891. !               QuantizationError(image,&mean_error_per_pixel,
  1892. !                 &normalized_mean_error,&normalized_maximum_error);
  1893. !               total_colors=NumberColors(image,(FILE *) NULL);
  1894. !             }
  1895. !           SyncImage(image);
  1896. !         }
  1897.       status=WriteAlienImage(image);
  1898.       if (verbose)
  1899.         {
  1900. ***************
  1901. *** 490,512 ****
  1902.             (void) fprintf(stderr," DirectClass ");
  1903.           else
  1904.             (void) fprintf(stderr," PseudoClass ");
  1905. !         if (total_colors != image->colors)
  1906. !           (void) fprintf(stderr,"%u=>",total_colors);
  1907. !         (void) fprintf(stderr,"%uc",image->colors);
  1908. !         if (number_colors > 0)
  1909.             {
  1910. !             double
  1911. !               normalized_maximum_error,
  1912. !               normalized_mean_error;
  1913. !             unsigned int
  1914. !               mean_error_per_pixel;
  1915. !             /*
  1916. !               Measure quantization error.
  1917. !             */
  1918. !             QuantizationError(image,&mean_error_per_pixel,
  1919. !               &normalized_mean_error,&normalized_maximum_error);
  1920.               (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  1921.                 normalized_mean_error,normalized_maximum_error);
  1922.             }
  1923. --- 504,514 ----
  1924.             (void) fprintf(stderr," DirectClass ");
  1925.           else
  1926.             (void) fprintf(stderr," PseudoClass ");
  1927. !         if (total_colors == 0)
  1928. !           (void) fprintf(stderr,"%uc",image->colors);
  1929. !         else
  1930.             {
  1931. !             (void) fprintf(stderr,"%lu=>%uc",total_colors,image->colors);
  1932.               (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  1933.                 normalized_mean_error,normalized_maximum_error);
  1934.             }
  1935. diff -r -c ImageMagick/utilities/mogrify.c ImageMagick2.2.3/utilities/mogrify.c
  1936. *** ImageMagick/utilities/mogrify.c    Tue Dec 22 16:05:24 1992
  1937. --- ImageMagick2.2.3/utilities/mogrify.c    Wed Dec 23 18:10:10 1992
  1938. ***************
  1939. *** 629,634 ****
  1940. --- 629,638 ----
  1941.         }
  1942.       else
  1943.         {
  1944. +         double
  1945. +           normalized_maximum_error,
  1946. +           normalized_mean_error;
  1947.           Image
  1948.             *image,
  1949.             info_image,
  1950. ***************
  1951. *** 637,642 ****
  1952. --- 641,649 ----
  1953.           time_t
  1954.             start_time;
  1955.   
  1956. +         unsigned int
  1957. +           mean_error_per_pixel;
  1958.           unsigned long
  1959.             total_colors;
  1960.   
  1961. ***************
  1962. *** 656,661 ****
  1963. --- 663,669 ----
  1964.             info_image=(*image);
  1965.             if (scene > 0)
  1966.               image->scene=scene;
  1967. +           total_colors=0;
  1968.             /*
  1969.               Transform image as defined by the clip, image and scale geometries.
  1970.             */
  1971. ***************
  1972. *** 796,810 ****
  1973.               InverseImage(image);
  1974.             if (normalize)
  1975.               NormalizeImage(image);
  1976. -           if (verbose)
  1977. -             {
  1978. -               /*
  1979. -                 Initialize image error attributes.
  1980. -               */
  1981. -               if (image->class == DirectClass)
  1982. -                 image->colors=NumberColors(image,(FILE *) NULL);
  1983. -               total_colors=image->colors;
  1984. -             }
  1985.             if (colorspace == GRAYColorspace)
  1986.               QuantizeImage(image,256,8,dither,GRAYColorspace,True);
  1987.             if (monochrome)
  1988. --- 804,809 ----
  1989. ***************
  1990. *** 812,819 ****
  1991.             if (number_colors > 0)
  1992.               if ((image->class == DirectClass) ||
  1993.                   (image->colors > number_colors))
  1994. !               QuantizeImage(image,number_colors,tree_depth,dither,colorspace,
  1995. !                 True);
  1996.             if (verbose)
  1997.               {
  1998.                 /*
  1999. --- 811,833 ----
  2000.             if (number_colors > 0)
  2001.               if ((image->class == DirectClass) ||
  2002.                   (image->colors > number_colors))
  2003. !               {
  2004. !                 /*
  2005. !                   Reduce the number of colors in the image.
  2006. !                 */
  2007. !                 QuantizeImage(image,number_colors,tree_depth,dither,colorspace,
  2008. !                   True);
  2009. !                 if (verbose)
  2010. !                   {
  2011. !                     /*
  2012. !                       Measure quantization error.
  2013. !                     */
  2014. !                     QuantizationError(image,&mean_error_per_pixel,
  2015. !                       &normalized_mean_error,&normalized_maximum_error);
  2016. !                     total_colors=NumberColors(image,(FILE *) NULL);
  2017. !                   }
  2018. !                 SyncImage(image);
  2019. !               }
  2020.             if (verbose)
  2021.               {
  2022.                 /*
  2023. ***************
  2024. *** 831,853 ****
  2025.                   (void) fprintf(stderr," DirectClass ");
  2026.                 else
  2027.                   (void) fprintf(stderr," PseudoClass ");
  2028. !               if (total_colors != image->colors)
  2029. !                 (void) fprintf(stderr,"%lu=>",total_colors);
  2030. !               (void) fprintf(stderr,"%uc",image->colors);
  2031. !               if ((number_colors > 0) || monochrome)
  2032.                   {
  2033. !                   double
  2034. !                     normalized_maximum_error,
  2035. !                     normalized_mean_error;
  2036. !                   unsigned int
  2037. !                     mean_error_per_pixel;
  2038. !                   /*
  2039. !                     Measure quantization error.
  2040. !                   */
  2041. !                   QuantizationError(image,&mean_error_per_pixel,
  2042. !                     &normalized_mean_error,&normalized_maximum_error);
  2043.                     (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  2044.                       normalized_mean_error,normalized_maximum_error);
  2045.                   }
  2046. --- 845,855 ----
  2047.                   (void) fprintf(stderr," DirectClass ");
  2048.                 else
  2049.                   (void) fprintf(stderr," PseudoClass ");
  2050. !               if (total_colors == 0)
  2051. !                 (void) fprintf(stderr,"%uc",image->colors);
  2052. !               else
  2053.                   {
  2054. !                   (void) fprintf(stderr,"%lu=>%uc",total_colors,image->colors);
  2055.                     (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  2056.                       normalized_mean_error,normalized_maximum_error);
  2057.                   }
  2058. diff -r -c ImageMagick/xtp/xtp.c ImageMagick2.2.3/xtp/xtp.c
  2059. *** ImageMagick/xtp/xtp.c    Tue Dec 22 16:05:32 1992
  2060. --- ImageMagick2.2.3/xtp/xtp.c    Wed Dec 23 21:12:13 1992
  2061. ***************
  2062. *** 313,319 ****
  2063.     (void) tcgetattr(STDIN_FILENO,&attributes);
  2064.     attributes.c_lflag&=(~ECHO);
  2065.     (void) tcsetattr(STDIN_FILENO,TCSANOW,&attributes);
  2066. !   gets(password);
  2067.     attributes.c_lflag|=ECHO;
  2068.     (void) tcsetattr(STDIN_FILENO,TCSANOW,&attributes);
  2069.     (void) fprintf(stdout,"\n");
  2070. --- 313,319 ----
  2071.     (void) tcgetattr(STDIN_FILENO,&attributes);
  2072.     attributes.c_lflag&=(~ECHO);
  2073.     (void) tcsetattr(STDIN_FILENO,TCSANOW,&attributes);
  2074. !   (void) gets(password);
  2075.     attributes.c_lflag|=ECHO;
  2076.     (void) tcsetattr(STDIN_FILENO,TCSANOW,&attributes);
  2077.     (void) fprintf(stdout,"\n");
  2078. -- 
  2079. cristy@dupont.com
  2080.