-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpngconv.txt
136 lines (92 loc) · 4.3 KB
/
pngconv.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
PngConv v0.0.3
=------------=
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:
========
v0.0.3 - 06/12/2006
- 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.
v0.0.2 - 07/11/2006
------
+ 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.
v0.0.1 - 06/11/2006
------
+ First public release.
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).
Future additions
================
- Output as screen$ format.
- Support colour.
- Allow stdin as input (allows piping from another command).
Examples
========
To convert a simple sprite image:
pngconv image.png image.out
To convert a sprite from a section of an image:
pngconv -pos=20,20 -size=16,16 image.png sprite.out
To output just the mask information:
pngconv -mask=m image.png mask.out
To output the mask information using purple as the mask:
pngconv -mask=m -mc=f0f image.png mask.out
To output the image data as text with "Data " leading:
pngconv -otxt -odb=Data\t image.png mask.out
To output alternate lines of inverted mask then byte, upside-down, zig-zagging
the sprite, as text to stdout:
pngconv -mask=mmbb -imask -usd -zz -otxt -ostd image.png
To output a simple sprite to a hex text file, with leading char of #:
pngconv -otxt -ohex=# -odb=BYTE image.png image.out
To output two sections of an image into a single file:
pngconv -pos=0,0 -size=8,64 image.png image.out
pngconv -pos=8,0 -size=8,64 -oapp image.png image.out
Documentation produced on: