Sixpack - Image converter and packer
Mic, 2009
micol972@gmail.com
Commandline options
-base n Specify the base color. For example if the image uses 4 colors and the base color is 2, the image colors will be mapped
to palette entries 2..5.
-bg x,y The color referenced by the pixel at x,y will be treated as the background color.
When this option isn't used x,y will be set to 0,0.
-height n Specify a new height for the image.
-image Treat the input file as an image file. If not specified the input file will be treated as a plain binary file.
-o filename Specify the output filename.
-opt Enable tile optimisation (redundant tiles will be excluded).
-pack Encode data before generating the output file.
-planes n Specify the desired number of bitplanes to use for storing each pixel. At least n planes will be used.
A value of 0 means that the smallest possible number of bitplanes will be used. The default value is 4, which is
also the maximum.
-preview filename Create a .BMP file with a preview of what the processed image will look like.
-q n Quantise the image to use n colors. The limits are 2 <= n <= 16.
-sizefilter n If n==1 smooth filtering will be used when resizing the image (when -width and/or -height is used).
Otherwise nearest neighbor sampling will be used.
-sms Specify the SEGA Master System as the output target.
-t Enable transparency. When this option is used, all pixels using the background color (see -bg) will be mapped to color 0.
-threshold n Set the threshold parameter for the LZSS codec. This can usually be left at the default value (2).
-unpack Decode the input file (not valid when -image is used).
-v Verbose mode.
-width n Specify a new width for the image.
Processing binary files
To LZSS encode a file:
sixpack.exe -pack filename.ext
sixpack.exe -pack -o filename.ext another_filename.ext
To LZSS decode a file:
sixpack.exe -unpack filename.ext
sixpack.exe -unpack -o filename.ext another_filename.ext
Processing images
Resize an image to 256*192, quantise it to 8 colors, remove redundant tiles and output pattern data for the SMS:
sixpack.exe -image -opt -width 256 -height 192 -q 8 -sms image.ext
Remove redundant tiles from an image, use the smallest possible number of bitplanes, enable transparency,
use the color from the pixel at 2,5 as the background color and LZSS encode the resulting pattern data:
sixpack.exe -pack -image -opt -sms -planes 0 -t -bg 2,5 image.ext
Sixpack uses code and algorithms from the following people:
CxImage by Davide Pizzolato
NeuQuant algorithm by Anthony Dekker
LZSS algorithm by James Storer and Thomas Szymanski