home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / FATE-LIT.LZX / lit-pc / convert / dtga / DTGA.TXT < prev    next >
Encoding:
Text File  |  1991-07-21  |  11.2 KB  |  299 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                               DTGA  Documentation
  8.                     Copyright (c) 1991 by Robert M. Crawford 
  9.                               All Rights Reserved
  10.                                  Version 1.0
  11.  
  12.  
  13.  
  14.  
  15.                                    CONTENTS  
  16.  
  17.    1.0  DISCLAIMER AND LICENSE STATEMENTS, ETC.
  18.    2.0  SYSTEM REQUIREMENTS.
  19.    3.0  LIST OF FILES.
  20.    4.0  INTRODUCTION.
  21.    5.0  USING DTGA.
  22.    5.1  COMMAND LINE OPTIONS.
  23.    
  24.  
  25.    1.0 DISCLAIMER AND LICENSE STATEMENTS, ETC.
  26.  
  27.    If you don't agree to BOTH the DISCLAIMER OF  WARRANTY  and  LICENSE  
  28.    AGREEMENT statements, please don't use this program.  
  29.  
  30.    -------------------------------------------------------------------------
  31.                              DISCLAIMER OF WARRANTY
  32.    -------------------------------------------------------------------------   
  33.  
  34.  
  35.    THIS SOFTWARE PROGRAM AND DOCUMENTATION ARE PROVIDED "AS IS" AND WITHOUT 
  36.    WARRANTIES AS TO PERFORMANCE.  
  37.  
  38.    THE PROGRAM DTGA IS PROVIDED WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES 
  39.    WHATSOEVER.  BECAUSE OF THE DIVERSITY OF CONDITIONS AND HARDWARE UNDER
  40.    WHICH THE PROGRAM MAY BE USED, NO WARRANTY OF FITNESS FOR A PARTICULAR
  41.    PURPOSE IS OFFERED.  THE USER IS ADVISED TO TEST THE PROGRAM THOROUGHLY
  42.    BEFORE RELYING ON IT.  THE USER MUST ASSUME THE ENTIRE RISK OF USING THIS
  43.    PROGRAM.  
  44.   
  45.  
  46.    -------------------------------------------------------------------------
  47.                                LICENSE  AGREEMENT
  48.    -------------------------------------------------------------------------   
  49.    The program, DTGA is protected under United States copyright law.  
  50.  
  51.    You may:
  52.  
  53.       1. Personally use the program on any machine free of charge.
  54.  
  55.       2. Make COMPLETE UNMODIFIED copies of the software package and 
  56.          distribute it for others to use.  
  57.  
  58.    You may not:
  59.  
  60.       1. Sell this program for a profit without written permission from the 
  61.          author, Robert M. Crawford.  
  62.  
  63.       2. Include this program as part of another commercial or shareware 
  64.          product without written permission from the author, Robert M.  
  65.          Crawford.  
  66.  
  67.       3. De-compile or disassemble the program.
  68.  
  69.  
  70.    -------------------------------------------------------------------------
  71.                                     SUPPORT
  72.    -------------------------------------------------------------------------
  73.  
  74.    I want to hear from you!  I can be reached by electronic mail:
  75.  
  76.            Compuserve  (76356,741)
  77.  
  78.       My US mailing address is:
  79.  
  80.              Robert M. Crawford
  81.              5699 Kanan Road #197
  82.              Agoura Hills, Ca. 91301 
  83.  
  84.  
  85.  
  86.    -------------------------------------------------------------------------   
  87.                           CREDITS  AND  TRADEMARKS
  88.    -------------------------------------------------------------------------   
  89.  
  90.  
  91.     IBM is a registered trademark of International Business Machines, Corp.  
  92.       
  93.     GIF and 'Graphics Interchange Format' are trademarks (tm) of Compuserve
  94.     Incorporated, an H&R Block Company.
  95.  
  96.  
  97.  
  98.    2.  SYSTEM REQUIREMENTS.
  99.  
  100.    DTGA runs on IBM PC, XT, AT, PS/2 (or clone) computers, with 512K of RAM, 
  101.    and DOS 2.0 or higher. 
  102.  
  103.  
  104.    3.  LIST OF FILES.
  105.  
  106.              File             Description
  107.  
  108.              README.1ST       Disclaimer of Warranty Statement.
  109.              DTGA.TXT         Software Documentation (this file).
  110.              DTGA.EXE         Targa-24 to 256-color GIF Conversion Program.
  111.  
  112.  
  113.    4.  INTRODUCTION.  
  114.  
  115.    I developed DTGA to see how my "tetrahedron partitioning" dither algorithm
  116.    works with 24-bit to 256-color reduction.  DTGA converts uncompressed 
  117.    Targa-24 files to 256-color GIF files.  I've been able to get some pretty 
  118.    good results, although sometimes I've had to fiddle with the command line 
  119.    parameters to get it.  
  120.  
  121.    The algorithm I'm using initially splits the color cube into 27 subcubes.
  122.    Each subcube is split into 6 tetrahedrons (162 total) .  This initial state 
  123.    requires 64 colors.  Next, a color histogram is built up from the image.
  124.    The algorithm keeps spliting the tetrahedron enclosing the pixels with
  125.    the largest weighted error until all the colors are exhausted or a minimum
  126.    error level is met.
  127.  
  128.    My current implementation has a problem effectively utilizing all 256 
  129.    colors.  I think I have a solution to the problem, but it's going to take
  130.    a major rewrite of the algorithm.  
  131.  
  132.      
  133.    5.   USING DTGA.
  134.  
  135.    DTGA uses a command line interface. The general syntax is:
  136.  
  137.                 dtga [options] source [destination]
  138.  
  139.    Command line parameters must be separated by at least one space. No 
  140.    spaces are allowed within a parameter.  
  141.  
  142.    Source is the TGA file to be . The file name may include the 
  143.    full path name.   If source does not have an extension .TGA is assumed.
  144.  
  145.    Destination is the outout GIF file name.  If destination doesn't have an 
  146.    extention, GIF is assumed.  If it isn't included in the command line the 
  147.    source file name is used but with the .GIF extention.  
  148.  
  149.    Command line options are, of course, optional.   More than one option can 
  150.    be specified.  A  summary of command line options can be displayed by 
  151.    executing DGIF without parameters.  
  152.  
  153.  
  154.  
  155.    5.1  COMMAND LINE OPTIONS.
  156.  
  157.  
  158.    --------------------------------------------------------------------------
  159.    -a                    Set Color Distibution
  160.    --------------------------------------------------------------------------
  161.    This option allows a parameter to be set that controls the distribution
  162.    of colors in the output image.  High values increase the number of dark
  163.    colors in the image.  The default value is 100.  Valid values are from
  164.    50 to 400.
  165.  
  166.    Example:
  167.  
  168.            dtga -a200 image  , increase the number of dark colors.
  169.  
  170.    --------------------------------------------------------------------------
  171.    -cd,-cl               Set Contast Limits
  172.    --------------------------------------------------------------------------
  173.    These options allows the image contrast to be adjusted.  Option -cd controls
  174.    the "dark limit" and option -cl controls the "lite limit".  Valid values
  175.    for the "dark limit" are 0 to 64 (default = 0).  Valid values for the  
  176.    lite limit are 191 to 255 (default = 255).
  177.  
  178.    Example:
  179.  
  180.            dtga -cd8 - cl239 image  , RGB component values are set to 0 if less
  181.                                       than 8. Values greater than 239 are set
  182.                                       to 255. Values between 8 and 239 are
  183.                                       spread evenly between 0 and 255.
  184.  
  185.    --------------------------------------------------------------------------
  186.    -d             Disable Use of Color Look-Up Table
  187.    --------------------------------------------------------------------------
  188.    By default DTGA builds up and uses a look-up table to speed up color 
  189.    selection.  If this option is used, the look-up table will not be used.
  190.    I included this option to see if the look-up table quantitization would
  191.    effect the output image (I haven't been able to tell the difference).
  192.  
  193.    --------------------------------------------------------------------------
  194.    -r,-g,-b          RGB Color Histogram  Quantitization
  195.    --------------------------------------------------------------------------
  196.    The color histogram is limited to 8000 entries, so the rgb colors have to
  197.    be quantized. By default DTA quantizes red and blue to 5-bits (3-bits 
  198.    discarded) and green to six bits (2-bits discarded) .  Using these values, 
  199.    the histogram may sometimes overflow (no new color are added).  These 
  200.    options allow you to increase the quantitization to prevent overflow.  You
  201.    can also reduce the quantitization to increase the number of colors in the
  202.    histogram. 
  203.  
  204.    Example:
  205.  
  206.            dtga -g3 image  
  207.  
  208.    --------------------------------------------------------------------------
  209.    -o                         Output Gamma
  210.    --------------------------------------------------------------------------
  211.    This option allows the output gamma to be adjusted.  The default value is
  212.    2.0.   Gamma values can range between 10 (1.0) and 40 (4.0).
  213.  
  214.    Example:
  215.  
  216.            dtga -o22 image   , set output gamma to 2.2.
  217.  
  218.  
  219.    --------------------------------------------------------------------------  
  220.    -e                         Minimum Error
  221.    --------------------------------------------------------------------------
  222.    This option lets you change the error level used to determine if a 
  223.    hetrahedron should be split.  The default value is 20.  Valid values
  224.    are from 8 (smallest error) to 50.
  225.  
  226.    Example:
  227.  
  228.            dtga -e30 image   
  229.  
  230.    --------------------------------------------------------------------------  
  231.    -f                         Use Fixed Color Table
  232.    --------------------------------------------------------------------------
  233.    This option lets you select a fixed 256 color table which is independant
  234.    of the input image.  The results are sometimes very good.
  235.  
  236.  
  237.    Example:
  238.  
  239.            dtga -f image   
  240.  
  241.  
  242.    --------------------------------------------------------------------------
  243.    -i                          Input Gamma 
  244.    --------------------------------------------------------------------------
  245.    This option allows the input gamma to be adjusted. The default value is
  246.    10 (1.0, no correction).  Gamma values can range between 10 (1.0) and
  247.    40 (3.0). 
  248.  
  249.    Example:
  250.  
  251.            dtga -i20 image  
  252.  
  253.    
  254.    --------------------------------------------------------------------------
  255.    -n                         Maximum Colors 
  256.    --------------------------------------------------------------------------
  257.    This option allows the number of output colors to be set. The default value
  258.    is 256.   Valid values are from 64 to 256.
  259.  
  260.    Example:
  261.  
  262.            dtga -n128 image   , limit gif image to 128 colors
  263.  
  264.    --------------------------------------------------------------------------
  265.    -m                         Set Pixel Threshold 
  266.    --------------------------------------------------------------------------
  267.    DTGA uses the number of pixels enclosed by a tetrahedron to decide if the
  268.    tetrahedron can be split.  If the number of pixels is less than a specified
  269.    threshold, the tetrahedron will not be split until all other tetrahedrons
  270.    exceeding the threshold and have weighted errors greater than the error
  271.    limit have been split.  The default value is 200 pixels.
  272.  
  273.  
  274.    Example:
  275.  
  276.            dtga -m100 image   , set limit to 100 pixels
  277.   
  278.    --------------------------------------------------------------------------
  279.    -w                         Color Weighting 
  280.    --------------------------------------------------------------------------
  281.    DTGA uses a weighted rgb distance measure when deciding how to split a
  282.    tetrahedron.  The edge with the largest weighted distance is split.
  283.    This option allows you to change the weighting used by DTGA. The default
  284.    values are 2 for red, 3 for green and 1 for blue (-w231). Valid values
  285.    are from 1 to 6 for eace color component.  Also, the sum of the weights is
  286.    limited to 10.
  287.  
  288.    Example:
  289.  
  290.            dtga -w111 image   , use equal weighting
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.