summaryrefslogtreecommitdiffstats
path: root/tkimg/doc/formats.htm
blob: b13528c7868bb137aa11f2227772ec293467a5ce (plain)
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Img Documentation</title>
  <meta http-equiv="Content-Type" content="text/html" />
</head>

<body>
<h1>Img Manual</h1>

<table width="100%">
  <tbody>
    <tr>
      <td><a href="index.htm">Introduction</a></td>
      <td><a href="install.htm">Installation</a></td>
      <td><a href="formats.htm">Format handlers</a></td>
      <td><a href="library.htm">External libraries</a></td>
    </tr>
  </tbody>
</table>

<h3>Format handlers</h3>
<dl>
  <dt>The pixmap image type can be used as follows:</dt>
    <dd>image create pixmap -file </dd>
  <dt>or</dt>
    <dd>image create pixmap -data ;#(in XPM format)</dd>
</dl>
<dl>
  <dt>The photo image type works the same:</dt>
    <dd>image create photo -file </dd>
  <dt>or</dt>
    <dd>image create photo -data ;#(base-64 encoding required with Tk8.2 and lower)</dd>
</dl>

<p>Valid format specifiers for reading photo's:</p>

<table width="100%">
  <tbody>
    <tr>
      <td width="10%">&nbsp;</td>
      <td>"bmp"</td>
      <td></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>"gif -index &lt;n&gt;"</td>
      <td></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>"jpeg -fast -grayscale"</td>
      <td></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>"png"</td>
      <td></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>"tiff"</td>
      <td></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>"xbm"</td>
      <td></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>"xpm"</td>
      <td></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>"postscript -index &lt;n&gt; -zoom &lt;x&gt; &lt;y&gt;"</td>
      <td>(-index not yet implemented) <!--<tr><td>&nbsp;<td>"pdf -index &lt;n> -zoom &lt;x> &lt;y>"<td>(-index not yet implemented)-->
      </td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>"window"</td>
      <td>(works only with "-data", not "-file")</td>
    </tr>
  </tbody>
</table>

<p>Valid format specifiers for writing photo's:</p>

<table width="100%">
  <tbody>
    <tr>
      <td width="10%">&nbsp;</td>
      <td>"bmp"</td>
      <td></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>"gif -interlaced &lt;bool&gt;"</td>
      <td>(-interlaced not yet implemented)</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>"jpeg -quality &lt;n&gt; -smooth &lt;n&gt; -grayscale -optimize

        -progressive"</td>
      <td></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>"png Author &lt;name&gt; Title &lt;title&gt; Description ....."<br />
        Each pair of arguments will add a named text chunk to the file.</td>
      <td></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>"tiff -compression &lt;compression&gt; -byteorder &lt;byteorder&gt;"</td>
      <td></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>"xbm"</td>
      <td></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>"xpm"</td>
      <td></td>
    </tr>
  </tbody>
</table>

<p>The format options have the following meaning:</p>

<table width="100%">
  <tbody>
    <tr>
      <td width="10%">&nbsp;</td>
      <td>-background C:</td>
      <td>use color C as background color for transparent parts of the
      image.</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>-byteorder:</td>
      <td>Byteorder for TIFF file. Should be one of bigendian, littleendian,
        network, smallendian or {}. Default: {}</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>-compression:</td>
      <td>Compression for TIFF file. Should be one of none, jpeg, packbits or
        deflate. Default: none.</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>-fast:</td>
      <td>Fast, low-quality processing.</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>-grayscale:</td>
      <td>Force incoming image to grayscale/ Create monochrome file.</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>-index N:</td>
      <td>Select one of the sub-images (GIF and postscript only, not yet
        implemented for postscript). Default value: 0</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>-interlaced N:</td>
      <td>N=1: interlaced. N=0: non-interlaced (not yet implemented).</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>-optimize:</td>
      <td>Optimize Huffman table.</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>-progressive:</td>
      <td>Create progressive file (JPEG only).</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>-quality N:</td>
      <td>Compression quality (0..100; 5-95 is useful range). Default value:
        75</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>-smooth N:</td>
      <td>Perform smoothing (10-30 is enough for most GIF's). Default value:
      0</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>-zoom X Y:</td>
      <td>Multiply image size by given scale factors. If Y is missing, the
        default is the same as X. X and Y are allowed to be in floating point
        format, but they are rounded to the nearest practically possible
        value. For postscript this means the zoom factors should be multiples
        of 1/72.</td>
    </tr>
  </tbody>
</table>
</body>
</html>