AUTHOR

  The author is cristy@dupont.com.  Comments, suggestions, or bug reports
  are welcome, but be kind.


AVAILABLILITY

  Anonymous FTP at export.lcs.mit.edu, file contrib/ImageMagick.tar.Z.
  It is also in the comp.sources.x archives as volume 13, issue 17.


UNIX COMPILATION

  Type:

    uncompress ImageMagick.tar.Z
    tar xvf ImageMagick.tar
    cd ImageMagick
    xmkmf
    make

  If you do not have 'xmkmf', edit 'Makefile' as required by your
  hardware environment and type 'make'.  The included Makefile is for a
  SUN SPARC architecture.

  Finally type:

    display images/mandrill.miff
    display -monochrome -dither images/mandrill.miff

  You can find other example images in the 'images' directory.

  Be sure to read the manual pages for the display, import, XtoPS,
  animate, and montage utilities.

  The X utilites read and write MIFF images.  Refer to the end of this
  message for more information about MIFF.  You can find filters to
  convert to and from the MIFF format in the 'filters' directory.  Change
  directory to the 'filters' directory and type 'make' to build them.  

  Two examples of using a filter follow:

    GIFtoMIFF image.gif - | display -

      or

    TIFFtoMIFF image.tiff image.miff
    display image.miff

  For convenience you might want to include the above statements in
  a shell script.  For example you could have a script called displayGIF
  or displayTIFF to display GIF or TIFF images respectively.

  The TIFFtoMIFF and MIFFtoTIFF filters require Sam Leffler's TIFF
  software available via FTP as sgi.com:/graphics/tiff/v2.4.tar.Z.

  The PPMtoMIFF and MIFFtoPPM filters require Jef Poskanzer's PBMPLUS
  software available via FTP as export.lcs.mit.edu:contrib/pbmplus.tar.Z.


VMS COMPILATION

  Type

    @make
    set display/create/node=node_name::

  where node_name is the DECNET X server to contact.

  Finally type:

    display images/mandrill.miff
    display -monochrome -dither images/mandrill.miff

ANIMATION
  
  To prevent colormap flashing, use a Standard Colormap, a static
  visual, or the -backdrop option.  You can define a Standard Colormap
  with the xstdcmap command.  For example, to use the "best" Standard
  Colormap, type:

    xstdcmap -best
    animate -map best scenes/dna.*

  or use a static visual:

    animate -visual staticcolor scenes/dna.*

  or finally use the -backdrop option:

    animate -backdrop scenes/dna.*

  Image filenames may appear in any order on the command line if the
  scene keyword is specified in the MIFF image.  Otherwise the images
  will display in the order they appear on the command line. A scene is
  specified when converting from another image format to MIFF by using
  the "scene" option with any filter.  To convert a TIFF images to a
  MIFF image as scene #2, type:

    TIFFtoMIFF -scene 2 image.tiff image.miff

NOTES

  1.  If you get a compile error on XTextProperty in PreR4Icccm.h, change it to 
      _XTextProperty. If you get a compile error on XVisualIDFromVisual 
      in PreR4Icccm.c, change it to _XVisualIDFromVisual.

  2.  24 bit images are reduced to 244 colors on an 8 bit display to help
      prevent colormap flashing.  If you want all 256 colors, type

        display -colors 256 image.miff

      To further help reduce colormap flashing, do not install the default
      standard colormap (RGB_DEFAULT_MAP).

  3.  If you have an 8 bit server and need to look at a 24 bit image
      frequently, reduce the number of colors to 256 once and write to
      a new image.  Then display this new image.  For example,

        display -colors 256 -dither -write image.8bit image.24bit
        display image.8bit

  4.  Use the import program to read any X window into a file that the
      display program can read.  Use the XtoPS utility to read any X
      window and output it as Postscript.

  5.  Machine dependancies:

      For MacX, set the DISPLAY variable to host:0.2 for the color rootless
      window.

      I suspect all the following problems will be fixed when these
      vendors upgrade to X11R4.  I find conditional compilation
      statements offensive.  So if you have any of the following
      problems, the fix must be applied manually.

      HP machines using Motif do not always generate an initial
      exposure event and therefore requires an extra XPutimage
      immediately preceding the X event loop in display.c.  The code 
      should look like this:

        /*
          Respond to events.
        */
        XPutImage(display,image_window.id,image_window.graphic_context,
          image_window.ximage,0,0,0,0,image_window.width,image_window.height);

      MIPS does not always generate exposure events correctly when
      displaying a monochrome image on their color server.  Holes in the
      image may appear when an area is blocked then exposed.  I do not
      currently have a solution for this problem.

      Images do not dislay correctly on the IBM R6000 visual with 4096
      colors.  However they do display correctly on the visual with 256
      colors.  Until IBM fixes their server, type xdpyinfo to determine 
      the ID of the 256 color visual and type

        display -visual 0x???? image.miff

      On the Stardent put

        *installColormap:  on

      in your X resource file.

      To get ImageMagick to work on our SGI I had to comment out
	
	#include <X11/Xos.h>

      in X.h and include

	#define XEventsQueued(display,QueuedAfterFlush)  XPending(display)

      I also included -DSYSV on the cc command line.

      IBM (RS/6000) and Digital (VMS) installed X11R4 include files but
      has X11R3 libraries.  Therefore, include -DPRE_R4_ICCCM in your
      compile statement to force the R3 compatibilities routines to
      compile properly.

  6.  I never had a chance to test this on a 16 bit machine.  If someone
      gets it working let me know and send any bug fixes.  Perhaps I
      should change 'unsigned int' to 'unsigned long'.

  7.  Scanned images may not benefit from my runlength-encoded
      compression.  To store images uncompressed, use this command:

        display +display +compress -write uncompressed.image compressed.image

  8.  On occasion, a window manager (twm) may get in strange state which will 
      cause the display program to work improperly.  Fix this by restarting the
      window manager.

  9.  If the image is displayed with incorrect colors, try using a different
      visual.  Type xdpyinfo and choose an alternative visual (if one exists)
      by either visual class or visual id.  For example, to specifically 
      choose a PseudoColor visual on a server that supports it, type

        display -visual pseudocolor image.miff

 10.  Make sure that the include file math.h defines the function atof as
      type double.  Otherwise the -gamma option will not work properly.


MIFF IMAGE FORMAT

  MIFF is an image format, which I developed.  I like it because it

    1) It is machine independant.  It can be read on virtually any computer.  
       No byte swapping is necessary.

    2) It has a text header.  Most image formats are coded in binary and you
       cannot easily tell attributes about the image.  Use 'more' on MIFF
       image files and the attributes are displayed in text form.

    3) It can handle runlength-encoded images.  Although most scanned images
       do not benefit from runlength-encoding, most computer-generated images
       do.  Images of mostly uniform colors have a high compression ratio and
       therefore take up less memory and disk space.

    4) It allows a scene number to be specified.  This allows you to specify
       an animation sequence out-of-order on the command line.  The correct
       order is determined by the scene number of each image.

  One way to get an image into MIFF format is to use one of the filters in
  the 'filters' directory or read it from an X window using the
  'import' program.  Alternatively, type the necessary header
  information in a file with a text editor.  Next, dump the binary
  bytes into another file.  Finally, type

    cat header binary_image | display -write image.miff -

  For example, suppose you have a raw red, green, blue image file on disk
  that is 640 by 480.  The header file would look like this:

    id=ImageMagick columns=640 rows=480 :

  The image file would have red, green, blue tuples (rgbrgbrgb...).

  Refer to the 'display' manual page for more details.

ACKNOWLEDGEMENTS

  Stuart Kemp (cpsrk@marlin.jcu.edu.au) for discovering that the 
  Postscript in image.c did not clear the stack properly.

  Bernd Lamparter (lampart@pi4.informatik.uni-mannheim.de) for discovering 
  that the the XWD header values cannot be used after byte swapping in
  the MIFFtoXWD filter.

COPYRIGHT

  Copyright 1990 E. I. du Pont de Nemours & Company

  Permission to use, copy, modify, distribute, and sell this software and
  its documentation for any purpose is hereby granted without fee,
  provided that the above copyright notice appear in all copies and that
  both that copyright notice and this permission notice appear in
  supporting documentation, and that the name of E. I. du Pont de Nemours
  & Company not be used in advertising or publicity pertaining to
  distribution of the software without specific, written prior
  permission.  E. I. du Pont de Nemours & Company makes no representations
  about the suitability of this software for any purpose.  It is provided
  "as is" without express or implied warranty.

  E. I. du Pont de Nemours & Company disclaims all warranties with regard
  to this software, including all implied warranties of merchantability
  and fitness, in no event shall E. I. du Pont de Nemours & Company be
  liable for any special, indirect or consequential damages or any
  damages whatsoever resulting from loss of use, data or profits, whether
  in an action of contract, negligence or other tortious action, arising
  out of or in connection with the use or performance of this software.
