home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sources / misc / 4231 < prev    next >
Encoding:
Text File  |  1992-12-27  |  62.4 KB  |  2,122 lines

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