summaryrefslogtreecommitdiff
path: root/sys/man/1/jpg
blob: 1b23aad723e5814249dd81ca83eceacab89bdc3e (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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
.TH JPG 1
.SH NAME
jpg, gif, png, tif, ppm, bmp, v210, yuv, ico, tga, tojpg, togeordi, togif, toppm, topng, totif, toico \- view and convert pictures
.SH SYNOPSIS
.B jpg
[
.B -39cdefFkJrtv
] [
.I file ...
]
.br
.B gif
[
.B -39cdektv
] [
.I file ...
]
.br
.B png
[
.B -39cdektv
] [
.I file ...
]
.br
.B tif
[
.B -39cdektv
] [
.I file ...
]
.br
.B ppm
[
.B -39cdektv
] [
.I file ...
]
.br
.B bmp
[
.B -39cdektv
] [
.I file ...
]
.br
.B v210
[
.B -39cdektv
] [
.I file ...
]
.br
.B tga
[
.B -39cdektv
] [
.I file ...
]
.br
.B yuv
[
.B -39cdektv
] [
.I file ...
]
.PP
.B tojpg
[
.B -c
.I comment
] [
.B -gs
] [
.I file
]
.br
.B togeordi
[
.B -c
.I comment
] [
.B -g
] [
.I file
]
.br
.B togif
[
.B -c
.I comment
] [
.B -l
.I loopcount
] [
.B -d
.I msec
] [
.B -t
.I transindex
] [
.I file ...
[
.B -d
.I msec
]
.I file ...
]
.br
.B toppm
[
.B -c
.I comment
] [
.B -r
] [
.I file
]
.br
.B topng
[
.B -c
.I comment
] [
.B -g
.I gamma
] [
.I file
]
.br
.B totif
[
.B -c
.I comment
] [
.B -bBgGhHlLmprtT
] [
.I file
]
.PP
.B ico
[
.B -c
] [
.I file
]
.br
.B toico
[
.I file ...
]
.SH DESCRIPTION
These programs read, display, and write image files in public formats.
.IR Jpg ,
.IR gif ,
.IR png ,
.IR tif ,
.IR ppm ,
.IR bmp ,
.IR tga ,
.IR v210 ,
and
.IR yuv
read files in the corresponding formats and, by default, display
them in the current window; options cause them instead to convert the images
to Plan 9 image format and write them to standard output.
.IR Tojpg ,
.IR togif ,
.IR toppm ,
.IR topng ,
and
.I totif
read Plan 9 images files, convert them to JPEG, GIF, PPM,
PNG, or TIFF and write them to standard output.
.PP
The default behavior of
.IR jpg ,
.IR gif ,
.IR png ,
.IR tif ,
.IR ppm ,
.IR bmp ,
.IR tga ,
.IR v210 ,
and
.IR yuv
is to display the
.IR file ,
or standard input if no file is named.
Once a file is displayed, typing a character causes the program to display the next image.
Typing a
.BR q ,
DEL, or control-D exits the program.
For a more user-friendly interface, use
.IR page (1),
which invokes these programs to convert the images to standard format,
displays them, and offers scrolling, panning, and menu-driven navigation among the files.
.PP
These programs share many options:
.TP
.B -e
Disable Floyd-Steinberg error diffusion, which is used to improve the appearance
of images on color-mapped displays, typically with 8 bits per pixel.
Primarily useful for debugging; if the display has true RGB color, the image
will be displayed in full glory.
.TP
.B -k
Convert and display the image as a black and white (really grey-scale) image.
.TP
.B -v
Convert the image to an RGBV color-mapped image, even if the
display has true RGB color.
.TP
.B -d
Suppress display of the image; this is set automatically by
any of the following options:
.TP
.B -c
Convert the image to a Plan 9 representation, as defined by
.IR image (6),
and write it to standard output.
.TP
.B -9
Like
.BR -c ,
but produce an uncompressed image.
This saves processing time, particularly when the output is
being piped to another program such as
.IR page (1),
since it avoids compression and decompression.
.TP
.B -t
Convert the image, if it is in color, to a true color RGB image.
.TP
.B -3
Like
.BR -t ,
but force the image to RGB even if it is originally grey-scale.
.PD
.PP
.I Jpg
has two extra options used to process the output of the LML
video card:
.TP
.B -f
Merge two adjacent images, which represent the two fields of a video picture,
into a single image.
.TP
.B -F
The input is a motion JPEG file, with multiple images representing frames of the movie.  Sets
.BR -f .
.PD
.PP
The
.IR tojpg ,
.IR togif ,
.IR toppm
and
.IR topng
programs go the other way: they convert from Plan 9 images to JPEG, GIF,
PPM, PNG, and TIFF and have no display capability.
They all accept an option
.B -c
to set the comment field of the resulting file.
The
.B -r
option makes
.I toppm
output raw PPM.
The default is to output plain PPM.
The
.B -g
option makes
.I tojpg
output grayscale images,
and the
.B -s
option makes it output scratched JPEG images.
.I Togeordi
is an
.IR rc (1)
script that invokes
.B tojpg
.BR -s .
.I Totif
accepts many options.
Choosing Huffman, T4, or T6 compression
forces the output to be a bilevel image.
.TP
.B -b
Output a bilevel (GREY1) image.
.TP
.B -B
Output a grayscale (GREY2) image.
.TP
.B -g
Output a grayscale (GREY4) image.
.TP
.B -G
Output a grayscale (GREY8) image.
.TP
.B -h
Use Huffman compression.
.TP
.B -H
Use T4 one-dimensional compression.
.TP
.B -l
Use LZW compression.
.TP
.B -L
Use LZW compression with horizontal differencing.
Note that some TIFF decoders may not accept horizontal
differencing applied to images with depths less than eight.
.TP
.B -m
Output a color (CMAP8) image.
.TP
.B -p
Use Packbits compression.
.TP
.B -r
Output a color (BGR24) image.
.TP
.B -t
Use T4 two-dimensional compression.
.TP
.B -T
Use T6 compression.
.PP
If there is only one input picture,
.I togif
converts the image to GIF format.
If there are many
.IR files ,
though, it will assemble them into an animated GIF file.
The options control this process:
.TP
.BI -l loopcount
By default, the animation will loop forever;
.I loopcount
specifies how many times to loop.
A value of zero means loop forever and a negative value means
to stop after playing the sequence once.
.TP
.BI -d msec
By default, the images are displayed as fast as they can be rendered.
This option specifies the time, in milliseconds, to pause while
displaying the next named
.IR file .
.PP
.I Gif
translates files that contain a `transparency' index by attaching
an alpha channel to the converted image.
.PP
.I Ico
displays or converts a Windows icon (.ico) file.  If no file is
specified,
.I ico
reads from standard input.
Icon files
contain sets of icons represented by an image and a mask. The
.B -c
option causes
.I ico
to convert the first icon in the set and write it to standard
output in compressed Plan 9 image format. Otherwise, the whole
icon set is displayed.
Clicking the right button pops up a menu that lets you
write any icon's image as a Plan 9 image (\fIwidth\fBx\fIheight\fB.image\fR),
write any icon's mask as a Plan 9 image (\fIwidth\fBx\fIheight\fB.mask\fR),
or exit.  Selecting one of the write menu items yields a sight cursor.
Move the sight over the icon and right click again to write.
.PP
.I Toico
takes a list of Plan 9 image files (or standard input) and creates
a single icon file.  The masks in the icon file will be the white
space in the image.  The icon file is written to standard output.
.SH SOURCE
.B /sys/src/cmd/jpg
.br
.B /rc/bin/togeordi
.SH "SEE ALSO"
.IR page (1),
.IR image (6).
.br
.B http://www.w3.org/Graphics/JPEG/jfif3.pdf
.br
.B http://www.w3.org/Graphics/JPEG/itu-t81.pdf
.br
.B http://en.wikibooks.org/wiki/JPEG_-_Idea_and_Practice
.br
.B http://en.wikipedia.org/wiki/JPEG
.br
.B http://www.w3.org/Graphics/GIF/spec-gif89a.txt
.br
.B http://www.w3.org/TR/2003/REC-PNG-20031110
.br
.B http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf
.br
.B http://netpbm.sourceforge.net/doc/ppm.html
.br
.B http://en.wikipedia.org/wiki/Windows_bitmap
.br
.B http://en.wikipedia.org/wiki/Yuv
.SH BUGS
Writing an animated GIF using
.I togif
is a clumsy undertaking.