1img-ppm(n) Img img-ppm(n)
2
3
4
5______________________________________________________________________________
6
8 img-ppm - Img, Portable Pixmap format (ppm)
9
11 package require Tk
12
13 package require img::ppm ?1.4?
14
15 image create photo ?name? ?options?
16
17______________________________________________________________________________
18
20 The package img::ppm is a sub-package of Img. It can be loaded as a
21 part of the complete Img support, via package require Img, or on its
22 own, via package require img::ppm.
23
24 Like all packages of Img it does not provide new commands, but extends
25 the existing Tk command image so that it supports files containing
26 raster images in the Portable Pixmap format (ppm). More specifically
27 img::ppm extends Tk's photo image type.
28
29 The name of the new format handler is ppm. This handler provides addi‐
30 tional configuration options. See section PPM OPTIONS for more detailed
31 explanations.
32
33 All of the above means that in a call like
34
35 image create photo ?name? ?options?
36
37 [1] Image data in ppm format (options -data and -file) is detected
38 automatically.
39
40 [2] The format name ppm is recognized by the option -format. In ad‐
41 dition the value for the option is treated as list and may con‐
42 tain any of the special options listed in section PPM OPTIONS.
43
45 This handler supports the PPM (Truecolor) and PGM (Greyscale) image
46 formats. There are two types of PPM/PGM files: RAW (binary) and ASCII.
47 The values stored in PPM/PGM files can be unsigned 8-bit or unsigned
48 16-bit values.
49
50
51
52 Grayscale (PGM): 8-bit and 16-bit, 1 channel per pixel.
53 Truecolor (PPM): 8-bit and 16-bit, 3 channels per pixel.
54
55 List of currently supported features:
56
57 Type | Read | Write |
58 | -file | -data | -file | -data |
59 ---------------------------------------------------
60 PGM 8-bit ASCII | Yes | Yes | No | No |
61 PGM 8-bit BINARY | Yes | Yes | No | No |
62 PGM 16-bit ASCII | Yes | Yes | No | No |
63 PGM 16-bit BINARY | Yes | Yes | No | No |
64 PPM 8-bit ASCII | Yes | Yes | Yes | Yes |
65 PPM 8-bit BINARY | Yes | Yes | Yes | Yes |
66 PPM 16-bit ASCII | Yes | Yes | No | No |
67 PPM 16-bit BINARY | Yes | Yes | No | No |
68
69
70
72 The handler provides the following options:
73
74 -verbose bool
75 This option is supported for reading and writing.
76
77 If set to true, additional information about the loaded/stored
78 image is printed to stdout. Default is false.
79
80 -scanorder string
81 This option is supported for reading only.
82
83 Specify the scanline order of the input image. Possible values:
84 TopDown or BottomUp. Default is TopDown.
85
86 -gamma float
87 This option is supported for reading only.
88
89 Specify a gamma correction to be applied when mapping 16-bit in‐
90 put data to 8-bit image values. Default is 1.0.
91
92 -min float
93 This option is supported for reading only.
94
95 Specify the minimum pixel value to be used for mapping 16-bit
96 input data to 8-bit image values. Default is the minimum value
97 found in the image data.
98
99 -max float
100 This option is supported for reading only.
101
102 Specify the maximum pixel value to be used for mapping 16-bit
103 input data to 8-bit image values. Default is the maximum value
104 found in the image data.
105
106 -ascii bool
107 This option is supported for writing only. If set to true, the
108 file is written in PPM 8-bit ASCII format (P3). Default is
109 false, i.e. write in PPM 8-bit binary format (P6).
110
112 img-bmp, img-dted, img-gif, img-ico, img-intro, img-jpeg, img-pcx, img-
113 pixmap, img-png, img-ppm, img-ps, img-raw, img-sgi, img-sun, img-tga,
114 img-tiff, img-window, img-xbm, img-xpm
115
117 image handling, ppm, tk
118
120 Copyright (c) 1995-2009 Jan Nijtmans <nijtmans@users.sourceforge.net>
121
122
123
124
125img-ppm 1.4 img-ppm(n)