PCXCLEAN v1.5                                                   1999 Elecbyte



1. Introduction

        PCXClean takes an input PCX file, and removes all colours not
        in a specified palette, leaving only the colours you want to
        keep.

        PCXClean may be used and distributed freely, but may not be
        sold for profit.


2. Usage

        The syntax for PCXClean is:

        PCXCLEAN [options] <infilename> <outfilename> <palettefile>
        PCXCLEAN -c [options] <files> <palettefile>

        Where:
        - options are described below

        - infilename is the input filename (an 8 or 24-bit pcx file)

        - outfilename is the output filename (a 8-bit pcx file.)
          Note that if outfilename is the same as infilename, it will
          overwrite the original file.

        - files is used only when batch conversion is used (-c).  You
          can use wildcards to specify what files to clean.  Using
          this mode overwrites the files.  Check examples for usage.

        - palettefile is the input palette file. Colour number 0 will
          be used as the masking colour. That is, the colour that is
          used to clean off unwanted colours.
          More information in section (3) below

        Note: to enable long filename support in a DOS box under
              Windows 9X, type
                SET LFN=1
              at the command prompt

        The options:
          -h -?  Prints a help message

          -b     Cleans out black pixels as well. This means that
                 pixels with colour RBG = 0,0,0 are treated as
                 unwanted pixels

          -r     Treats palettefile as an unreversed palette.
                 The palette file is read in reversed format by
                 default. See Section (3) below for details

          -c     Batch Conversion processing. When using -c, PCXClean
                 can only overwrite files. You should backup your
                 files before using this.
                 Batch Conversion will work in text mode; all
                 graphics-related switches will be ignored.

          -t     Force text mode display. Default mode is graphical
                 display at 640x480 in 16-bit colour.

          -w     Wait for keypress after conversion is done
                 (graphical display mode only)

          -y     Automatically answers "yes" to all prompts, such as
                 overwriting a file, etc

          -g???  Sets the graphics resolution and colour depth.
                 ??? should be in the form WxHxD, where
                 W-width, H-height, D-depth

                 eg. for 320x240 16-bit (65536 colours), use:

                     -g320x240x16

                 The default is 640x480 16-bit. If PCXClean is unable
                 to change to the specified or default graphics mode,
                 it will use VGA mode (320x200x8.) In general, colour
                 depths of 8 or below will make the display look very
                 bad.

                 Please note that the quality of the display does not
                 affect the output PCX file.



        Some examples

        1. To clean up an input file "in.pcx", and write it to
           "out.pcx", using "mypal.act" as the palette file, type:

             pcxclean in.pcx out.pcx mypal.act

        2. To clean up an input file "in.pcx", and write it over
           itself, using "mypal.act" as the palette file, in text
           mode, answering yes to all, type:

             pcxclean -t -y in.pcx in.pcx mypal.act

        3. To clean up an input file "in.pcx", and write it to
           "out.pcx", using "mypal.act" as the palette file, in video
           mode 320x240x32-bit, and pausing when done, type:

             pcxclean -g320x240x32 -w in.pcx out.pcx mypal.act

        4. To clean up all the .pcx files in the directory player,
           type:

             pcxclean -c player\*.pcx player.act

        5. To clean up an entire directory using text mode and
           automatically answering yes to all questions, type:

             pcxclean -c -y -t player\*.pcx player.act

           You should use this method once you get all your sprites
           done.

           Note:  Using the -c option will overwrite your files
           with the new file.  You might want to backup your files
           before using batch conversion.

3. The palette file format

        This section is somewhat technical.

        The input palette file is expected to be 768 bytes long, and
        have the following format:

          Triples of bytes representing R,G,B values respectively,
          with a range of 0-255. The triples should be stored in
          reverse order, ie. the first triple in the file maps
          to the last triple of the palette, etc.
          (Note: You can force PCXClean to read the palette in a
                 non-reversed order by using the "-r" option.)

        This palette file can be generated by most image editing
        programs. If you prefer, there is a program included in this
        package named PCXPAL.EXE that extracts the palette off an
        8-bit PCX file and saves it in this format.

	Also included is a program named PAL2ACT.EXE that takes
	Paint Shop Pro 5 palettes and converts them to .act format.

	Usage is:
 	pal2act <infile> <outfile>

	Example:
	pal2act mypal.pal mypal.act



