home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / JAGDEV_1.LZH / DEVELOP.JAG / VECTRONI.X! / JAGPEG / TGAJAGPC.TXT < prev   
Text File  |  1994-09-26  |  8KB  |  237 lines

  1. -------------------------------------
  2. JagPeg Conversion Tools version 1.5
  3. PC Version Release 1.2
  4. Release Date: 9/24/94
  5.  
  6. CONFIDENTIAL INFORMATION
  7. -------------------------------------
  8.  
  9. Copyright 1993 Atari Corp. All Rights Reserved.
  10. Author: Mike Pooler, Atari Corp.
  11. Update: Mike Fulton, Atari Corp.
  12.  
  13. Introduction
  14. ------------
  15.  
  16. This describes how to use TGAJAG, a group of utility programs that convert a
  17. Targa file (.TGA) to a JagPeg file (.JAG).
  18.  
  19. Background: JagPeg is Atari's version of JPEG.  A JagPeg file has a .JAG
  20. extension, and it contains one compressed 24-bit true color bitmap.  It is
  21. uncompressed by a program called DEJAG, which runs in the Jaguar's GPU.
  22. DEJAG is described seperatly (see DEJAG.DOC).
  23.  
  24. The main utility for performing the conversion process is named TGAJAG.  On
  25. MS-DOS, TGAJAG is an executable program named TGAJAG.EXE.
  26.  
  27.  
  28. Input Files
  29. -----------
  30.  
  31. TGAJAG takes the filename of a Targa file as its first argument.  The Targa
  32. file must be:
  33.  
  34. - Uncompressed (Image type 2)
  35.  
  36. - 24-bits per pixel
  37.  
  38. - A multiple of 8 pixels in width
  39.   (If HALF or QUAD subsampling, a multiple of 16 pixels in width)
  40.   (Subsampling is explained below)
  41.  
  42. - A multiple of 8 pixels in height
  43.   (If QUAD subsampling, a multiple of 16 pixels in height)
  44.  
  45. Some Targa files which meet the above requirements are stored from bottom-up,
  46. (with the first screen-line at the end of the file), others from top-down.
  47. Both types are supported by TGAJAG.
  48.  
  49.  
  50.  
  51. Output Files
  52. ------------
  53.  
  54. TGAJAG writes two files as output.  The first is a JagPeg file (.JAG), which
  55. has this format:
  56.  
  57. [Word 0]  JagPeg version number (currently 1)
  58.  
  59. [Word 1]  Picture format code
  60.  
  61.         1: YCrCb with no subsampling
  62.             2: YCrCb with HALF subsampling
  63.             3: YCrCb with QUAD subsampling
  64.  
  65. [Word 2]  Width in 8-pixel blocks (e.g. 40 == 320 pixels)
  66.  
  67. [Word 3]  Height in 8-pixel blocks
  68.  
  69. [Data...]
  70.  
  71. The second output file from TGAJAG is a file containing a dequantization table
  72. for the requested compression quality, which is required by the JPEG decoding
  73. routines.  This file will named 'DQ??.DAT' (where the ?? is the quality
  74. percentage).
  75.  
  76.  
  77.  
  78. Using TGAJAG
  79. ------------
  80.  
  81. TGAJAG for MSDOS takes a command line of the form:
  82.  
  83.    TGAJAG [-quality n] [-quiet] [-o outputfile] [-quad | -half] inputfile
  84.  
  85. The command line options may be used in any order, but only one input file
  86. may be specified, or else an error is generated.
  87.  
  88. -quality n      Sets the JPEG compression quality/compression ratio percentage.
  89.                 The value 'n' must be between 1-100.  The higher the value,
  90.                 the higher the image quality and the less the image is
  91.         compressed.
  92.  
  93. -quiet          Supresses status messages from being shown on screen during
  94.                 the conversion process.
  95.  
  96. -o outputfile   Allows you to specify the desired filename of the converted
  97.                 picture file that will be output.
  98.  
  99. -quad or -half  Specify either QUAD or HALF subsampling.  The default is to
  100.                 use neither QUAD or HALF subsampling.  See below for more
  101.         information.
  102.  
  103. inputfile       This parameter is the filename of the .TGA Targa picture file
  104.         to be converted.  You may leave off the ".TGA" extension if
  105.         you want.  The resulting .JAG file will be placed into the
  106.         same directory as the inputfile, but the DQ??.DAT file will
  107.         be placed into the current directory.
  108.  
  109. Examples:
  110.  
  111.    tgajag -quality 60 cat
  112.  
  113. will convert CAT.TGA to CAT.JAG with quality setting of 60.
  114.  
  115.  
  116.    tgajag -half -quality 75 ship
  117.  
  118. will convert SHIP.TGA to SHIP.JAG, using HALF subsampling, and a quality
  119. setting of 75.
  120.  
  121.  
  122.  
  123.  
  124. Image Quality
  125. -------------
  126.  
  127. For most purposes, an image quality setting between 60 and 80 will provide
  128. the best balance between compression ratio and quality.  High quality
  129. settings give less lossy compression, thus larger .JAG file sizes.  Lower
  130. numbers get you better compression and smaller files, but if the number is
  131. too low you will get a visable degradation in visual quality (this will
  132. appear as fuzzyness and/or blockiness).
  133.  
  134. The goal is to find a quality setting that gives you acceptable compression
  135. and a picture that is is nearly indistinguishable from the original .TGA,
  136. visually.  This "ideal" setting is different for different pictures, so it's
  137. a matter of trial and error.
  138.  
  139. The default quality setting is 75, which is usually a good starting point.
  140. If you go much above 75 you lose more and more compression without a
  141. significant gain in image quality.
  142.  
  143. TGAJAG produces a unique "dequantize" table for each quality setting, which
  144. is used during the decompression process (see DEJAG.DOC).
  145.  
  146.  
  147.  
  148. SUBSAMPLING
  149. -----------
  150.  
  151. You also have the option of using HALF subsampling or QUAD subsampling.
  152.  
  153. HALF subsampling means that the picture's color components are cut to half
  154. their horizontal size before processing by CJPEG.  (The luminance component
  155. is left as is).  While this is quite lossy, it often produces little visable
  156. change in the final output, while getting a good reduction in size.  We
  157. recommend that you use HALF subsampling as your default starting point.
  158.  
  159. QUAD subsampling means that the picture's color components are cut to one
  160. quarter the original size (half vertical, half horizontal) before processing.
  161. Size reductions over HALF are less dramatic, visual differences are more
  162. dramatic.  It may be worth a try, but we recommend HALF as your best option.
  163.  
  164. Remember if you use HALF or QUAD, picture width must be a multiple of 16
  165. pixels (instead of 8).  If you use QUAD, picture height must be a mulitple of
  166. 16 pixels.
  167.  
  168. Decompression speed is DIRECTLY related to .JAG size.  A .JAG file that is
  169. 30% smaller than another will usually decompress in about 30% less time.
  170.  
  171.  
  172.  
  173.  
  174. Notes
  175. -----
  176.  
  177. Free disk space requirements for TGAJAG are such that you should have at
  178. least double the size of your TGA file, to be safe, before running TGAJAG
  179. (e.g.  for a 200K TGA file, have 400K free).
  180.  
  181. Note that the utilities do not all detect disk-full conditions, and they will
  182. probably do a whole lot of nothing once disk space runs out (even if they
  183. look like they're working).
  184.  
  185. If the final JAG file is larger than you expect, try using HALF subsampling
  186. and/or a lower quality setting.
  187.  
  188. There is little error checking - if you feed it an illegal Targa picture (see
  189. above), or a bad filename, it may do ungraceful things.
  190.  
  191.  
  192. v1.2 Release Notes:
  193. -------------------
  194.  
  195. The MSDOS version formerly used the batch files TGAJAG.BAT, TGAJAGH.BAT, and
  196. TGAJAGQ.BAT to run the various steps of the conversion process.  They have
  197. been replaced by TGAJAG.EXE, which performs the same operation, but with
  198. better control over the various options and with better error checking.
  199.  
  200. Note also that the archive setup has been changed so that the tools install
  201. into the JAGUAR\BIN directory instead of JAGUAR\BIN\TGAJAG.  This was done so
  202. that you can call the conversion utilities directly from your project's
  203. directory, rather than changing to the utilities directory.  Please note that
  204. the JAGUAR\BIN\TGAJAG directory is no longer used by the archives at all.
  205.  
  206. To avoid filename conflicts with other utilities, the filenames of the JAGPEG
  207. compression utilities have been changed.  Basically, a "j" was added to the
  208. beginning of the filename.  The old names and new names are shown below.
  209.  
  210. Old Name  New Name
  211. --------  --------
  212. STRIP     JSTRIP
  213. QUAD      JQUAD
  214. MERGE     JMERGE
  215. MERGEH    JMERGEH
  216. MERGEQ    JMERGEQ
  217. SPLIT     JSPLIT
  218. SPLITH    JSPLITH
  219. SPLITQ    JSPLITQ
  220. MAKEQ     JMAKEQ
  221. CJPEG     JCJPEG
  222.  
  223. Normally you don't call these programs yourself directly; they are called by
  224. the TGAJAG program.  If you have old versions of these files, please delete
  225. them.
  226.  
  227.  
  228. v1.1 Release Notes:
  229. -------------------
  230. Earlier versions of the PC version of the MAKEQ tool (one of the utilities
  231. called by TGAJAG) did not work correctly, but this has now been fixed.
  232.  
  233. Earlier versions of the TGAJAG tools used an .ABS extension for the DQ??.ABS
  234. files they created.  This has been changed to create a DQ??.DAT file instead,
  235. to avoid confusion with the .ABS files created by the ALN linker.
  236.  
  237.