ansi2png: converts ANSI art to PNG images.
------------------------------------------
v2.0.7 2023-02-12 by James D. Lin

The latest version of ansi2png can be downloaded from:
<http://www.taenarum.com/software/>


1. Introduction
---------------
  ansi2png is a program to convert ANSI image files to PNG images.  ANSI
  images are text-based and cannot be accurately converted to raster
  images with conventional tools.

  ansi2png is meant to be used for static images and is not intended for
  use with animated ANSIs.


2. Requirements
---------------
  * Windows 95 or later.


3. Usage
--------
  ansi2png [options] [--] file [...]
  ansi2png --help

  Options:

  -h, --help    Show help.  Use with --verbose to show the manual.

  --version     Show version information.

  --50          Use 50-line mode.  This option cannot be used in
                combination with aspect ratio correction (-a) or with an
                external font file (-f).

  --ascii       ASCII mode.  Overrides all other modes.

  -a, --aspect  Correct aspect ratio for square pixels.  This option cannot
                be used in combination with 50-line mode (--50), with an
                external font file (-f), or with the gutter (-g).

  -b, --iceColor
                Replace blinking with high-intensity backgrounds (a.k.a.
                iCE Color).

  -f, --font=PNG
                Load the specific glyph set from the given PNG file.  See
                section A1 (Glyph PNG Files) for more information.  This
                option cannot be used in combination with 50-line mode
                (--50) or with aspect ratio correction (-a).

  -g, --gutter  Enable the 1-pixel gutter between characters.  When
                enabled, each character glyph has a 1-pixel-wide gutter on
                its right side.  This generates a more authentic rendering
                although it affects the aspect ratio.  This option cannot
                be used in combination with aspect ratio correction (-a).

  -i, --no-invisible
                Disable invisible characters.

  -o=directory  Output to the specified, existing directory.

  -p, --palette=file
                Load the specified palette file.  See section A2 (Palette
                Definition Files) for more information.

  -s, --special Show glyphs for special (non-printable) characters.  By
                default, special characters are non-printing characters
                that have special functions.  These characters include:
                   8 backspace
                   9 tab
                  10 newline/linefeed
                  12 pagebreak/formfeed
                  13 carriage return
                  26 DOS EOF
                  27 escape

  -t, --tab=n   Sets tab spacing.  Default value is 8.

  -u, --underline
                Enable underlined characters.

  -v, --verbose Verbose output.  Prints extra diagnostic information to the
                screen.

  -n            Never overwrite existing files.
  -y            Always overwrite existing files.

  --            Specifies that there are no more options.  This is
                necessary if one of the input filenames begins with a
                hyphen.


4. Unimplemented Features and Known Issues
------------------------------------------
  * Not all escape codes are handled.  These include (but are not limited
    to):
       {ESC}[6n    (report cursor position)
       {ESC}[=#h   (set display mode)
       {ESC}[#;#p  (remap key)

  * Does not support BIN/XBIN files.

  * Individual special characters cannot be toggled independently.

  * Does not support animated ANSis.

  * Does not support blinking.


5. Files
--------
  ansi2png.exe
  readme.txt
  std25.png         A sample glyph set for a typical 80x25 DOS font.
                    Each glyph is 8x16 pixels.  Corresponds to running
                    ansi2png with no arguments.
  std50.png         A sample glyph set for a typical 80x50 DOS font.  Each
                    glyph is 8x8 pixels.  Corresponds to running
                    ansi2png --50.
  std25ar.png       A version of std25.png adjusted for a square pixel
                    aspect ratio.  Each glyph is 9x20 pixels.  Corresponds
                    to running ansi2png -a.
  std25half.png     A half-sized version of std25.png.  Each glyph is 4x8
                    pixels.
  std25quarter.png  A quarter-sized version of std25.png.  Each glyph is
                    2x4 pixels.
  palette.txt       A sample palette definition file.


6. Revision History
-------------------
  2.0.7 (2023-02-12)
    * Fixed incorrect reading of indexed PNG images.
    * Updated to use libpng 1.6.39 and zlib 1.2.13.

  2.0.6 (2012-05-07)
    * --help now may be used with --verbose to show the full manual.
    * Updated to use libpng 1.5.10.

  2.0.5 (2009-10-18)
    * Fix crash introduced in v2.0.4 caused by bundling 1-bit PNG glyphs
      instead of 8-bit ones.  Oops.  Now should support reading PNG files
      of arbitrary bit depths.

  2.0.4 (2009-10-04)
    * -a and -g no longer can be used together.
    * Tweaked the default 25-line glyphs a bit.
    * Updated to use libpng 1.2.40.
    * No longer writes invalid IEND data in the generated PNG files.
    * Added more details to the readme.txt regarding command-line options.

  2.0.3 (2007-07-05)
    * Updated to use libpng 1.2.18 and zlib 1.2.5.
    * Cleaned up some of the code to handle command-line arguments.

  2.0.2 (2006-07-15)
    * Fixed handling of repeated high-intensity attributes.

  2.0.1 (2006-05-29)
    * Fixed dependency on msvcr80.dll and msvcp80.dll.

  2.0 (2006-05-22)
    * Now outputs PNG images instead of Windows BMP images.
    * Renamed from ansi2bmp to ansi2png.
    * Made some shading adjustments to std25quarter.png.

  1.0 (2006-02-26)
    * Initial release.


7. Contact Information
----------------------
  To report bugs, visit:
     <http://www.taenarum.com/contact.html>


A1. Glyph PNG Files
-------------------
  The PNG file of glyph data passed to the --font option must be comprised
  of 8 rows with 32 glyphs per row.  Each individual glyph must have the
  same width and height.

  Black pixels correspond to "off" (background) pixels; all non-black
  pixels are considered to be "on" (foreground pixels).

  Several sample files are provided.


A2. Palette Definition Files
----------------------------
  The file of palette data passed to the --palette option is a text file
  composed of comma- or space-delimited integer values representing RGB
  triplets for each palette entry.  The values may be given in decimal,
  octal, or hexadecimal format.

  "//" indicates the start of a comment, and everything that follows it on
  that line will be ignored.

  A sample file is provided.


A3. Legal Gibberish
-------------------
  ansi2png copyright (c) 2006-2023 James Lin.

  Please do not redistribute without permission.

  By using this software, you agree to the following:

  * This software is provided on an "as is" basis without warranty of any
    kind, express or implied.

  * The author takes no responsibility for any damages incurred by using
    this software.

  libpng:
  * Copyright (c) 1995-2022 The PNG Reference Library Authors.
  * Copyright (c) 2018-2022 Cosmin Truta.
  * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
  * Copyright (c) 1996-1997 Andreas Dilger.
  * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.

  zlib
  * Copyright (c) 1995-2022 Jean-loup Gailly and Mark Adler.
