RastaConverter by Jakub 'Ilmenit' Debski / 04.2012

Usage:
RastaConverter.exe InputFile [options]

To save the output during the optimization process press 's' key.

Copy created output files to the Generator directory and run 'build.bat' to create executable file.

The application displays three images:
- the left one is the original picture resized to Atari width.
- the right one is the original picture mapped to choosen Atari palette. This is our goal to reach.
- the cental one is preview of the output picture.

If the colors on the right image are wrong (f.e. too gray) then try some different palette file
or remap original picture to choosen palette file using other tool f.e. Timanthes.
Below on the screen are some statistics from the optimization process.
With the current algorithm the longer you wait, the better results you get. 
For some pictures more than 1 million of evaluations is needed to get really good results.

Command line options:

/i=Input File
  File to process. All the formats of the FreeImage library supported, including JPG, PNG, GIF and BMP.
  Warning: it is not possible to load 16 colors pictures (4 bits per pixel). Increase the color depth first
  using other graphics program.

/h=Output Height
  Default: 240.
  Generated file height. The speed of the optimization process depends on the height.
  
/continue
  Continue previously stopped process. Currently it uses previously generated files (output*.*) therefore
  be careful not to overwrite them with other instance of RastaConverter. 

/pal=Palette File
  Default: Palettes\altirra.act
  The output quality depends a lot on similarity between chosen Atari palette and the image palette.
  The default palette covers a large color range and is close to real Atari palette.
  Converting GFX from C64 it is usually better to use: /pal=Palettes\laoo.act     
  You can also use shorcuts: /pal=laoo and the converter will try to load palette from 'Palettes\laoo.act'
  
/dither=Dithering Type
  Possible dithering types are: chess, floyd, 2d, jarvis, simple, knoll
  'chess' is Chessboard Dithering - typical 8bit dithering technique
  'floyd' is Floyd-Steinberg dithering - more "random" than chessboard dithering
  '2d' and 'simple' are between chess and floyd.
  'jarvis' dithering is more artistic
  'knoll' is similar to Adobe patented pattern dithering algorithm

/dither_val=Dithering strength
  Default: 1, should be set from 0.0 to 3.0. 
  Some dithering algorithms set to /dither_val=2 may increase color saturation if the output picture is too gray.

/dither_rand=Dithering randomness
  Default: 0, should be set from 0.0 to 1.0
  Current implementation of dithering algorithm produces output which may look too patterned.
  Set /dither_rand to 0.5 or 1.0 to make output more random.

/details=Details picture
  To help the optimization algorithm you can set the details mask. 
  The brighter the color on the mask is, the higher is distance of the color difference between input and output file on the masked region.
  This way you can make some objects like faces, eyes or other small objects more detailed.

/details_val=Details influence strength
  Default: 1


/filter=Resize filter
  Default: lanczos, other recommended: box  
  Filter used to resize the picture to the Atari width=160 color pixels (40 bytes). 
  For most of the pictures the default filter is the best, but converting pictures from C64
  /filter=box is recommended - it preserves details better.
	Possible filters are: lanczos, box, bicubic, bilinear, bspline, catmullrom

/init=Initial optimization state
   Default: random
   The optimization search space is large and the final results depends a lot on the initial values.
   You may see that RastaConverter sometimes optimizes not those details of the picture that you want.
   To change the initial value you may use other states: random, empty, less, smart
   
   '/init=less' option sets less colors in the initial state of the picture. This gives better result
   quick, but then picture is harder to optimize than with /init=smart 

/o=Output File
  Output file name. The default name is 'output.png'. 
  Using a different name you have to change the file names used in the Generator.
  
/s=Number of solutions
  You may set a different number of solutions used in the optimization process.
  With /s=1 (default) the optimization algorithm is heuristic Hill Climbing.
  With more solutions the Tabu Search algorithm is used. It may produce a better picture, 
  but it is usually better/faster to run the Hill Climbing a few times.

/distance=Color distance function
  Default: yuv, other options: euclid, ciede
  
  euclid - Use Euclidian RGB distance for colors instead of default YUV distance. This function is fast.
  yuv - produces usually better color mapping than Euclidian, but for some pictures RGB distance is also useful.
  ciede - uses the best visual color distance algorithm CIEDE2000, but can be very slow.
    
/max_evals=Maximum number of evaluations
  RastaConverter will save the current solution and exit when this limit is
  reached.

Example:
RastaConverter.exe c64.png /filter=box /h=200 /pal=palettes\laoo.act

