PngConv
PNGConv is a PNG to ZX Spectrum Image Convertor. The aim is to allow you to perform image conversions from the command-line, primarily from within a makefile or batch file.
History
- Fixed a possible problem when using a colour as a mask. It could potentially be recognised as image data. + Added "-oapp" option to append output to a file. + Added "-ohex[=<str>]" option to output as Hex text.
+ Allow definition of a colour as mask. Overrides use of Alpha channel if specified. + Allow inversion of image data as well as mask. Default was White = On. - Shuffled around a loop to remove some duplicate code and make things a little more manageable. + Added "-odb=" option to provide alternate leading text on output.
+ First public release.
Instructions
Command Line
============
PngConv [options] input [output]
Detail:
input : This parameter is required and is the source .png file. There
is no required format - the image will be converted internally
to the correct format, providing the image can be read by
pnglib. Masking for the output sprite is taken from the alpha
channel of the input, or the specified colour.
output : This is the output file. If this parameter is not given the
output will default to "<input>.out".
-h|help : Display the help.
-ver : Display version information.
-ss : Silent mode.
-pos=x,y : Origin of image to be pulled from the input.
Defaults to 0,0 (top-left).
-size=x,y : Size of the output image. Defaults to the size of the input.
Can be larger than the input.
-mask=<mask> : Format of the output mask:
b : Output only Image (default)
m : Output only Mask
mb : Alternate Mask and Image bytes
bm : Alternate Image and Mask bytes
mmbb : Alternate Mask and Image lines
bbmm : Alternate Image and Mask lines
-mc=rgb : Take mask from the specified RGB colour (3 hex-digits).
Overrides use of alpha channel for the mask.
-imask : Invert the mask bits.
-iimg : Invert the image bits (default is black off, white on).
-ostd : Send output to stdout (console) rather than a file.
This option implies -ss.
-otxt : Output as text.
-odb=<db> : Set leading text to <db>. Defaults to "db ". Tab characters
can be entered using "\t". -odb= on it's own gives no
leading text.
-ohex[=<$>] : Set text output to Hex format, with optional leading char.
Default is to output in decimal.
Defaults leading hex char is "$".
-obin : Output as binary (default).
-oapp : Append output (default erases original output file).
-ltr|rtl : Output left-to-right (default), or right-to-left.
-zz : ZigZag (alternate lines ltr/rtl).
-usd : Output upside-down (bottom line first in memory).
Examples of Usage
Future additions
- Output as screen$ format.
- Support colour.
- Allow stdin as input (allows piping from another command).