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
41 addition the value for the option is treated as list and may
42 contain any of the special options listed in section PPM
43 OPTIONS.
44
46 This handler supports the PPM (Truecolor) and PGM (Greyscale) image
47 formats. There are two types of PPM/PGM files: RAW (binary) and ASCII.
48 The values stored in PPM/PGM files can be unsigned 8-bit or unsigned
49 16-bit values.
50
51
52
53 Grayscale (PGM): 8-bit and 16-bit, 1 channel per pixel.
54 Truecolor (PPM): 8-bit and 16-bit, 3 channels per pixel.
55
56 List of currently supported features:
57
58 Type | Read | Write |
59 | -file | -data | -file | -data |
60 ---------------------------------------------------
61 PGM 8-bit ASCII | Yes | Yes | No | No |
62 PGM 8-bit BINARY | Yes | Yes | No | No |
63 PGM 16-bit ASCII | Yes | Yes | No | No |
64 PGM 16-bit BINARY | Yes | Yes | No | No |
65 PPM 8-bit ASCII | Yes | Yes | Yes | Yes |
66 PPM 8-bit BINARY | Yes | Yes | Yes | Yes |
67 PPM 16-bit ASCII | Yes | Yes | No | No |
68 PPM 16-bit BINARY | Yes | Yes | No | No |
69
70
71
73 The handler provides the following options:
74
75 -verbose bool
76 This option is supported for reading and writing.
77
78 If set to true, additional information about the loaded/stored
79 image is printed to stdout. Default is false.
80
81 -scanorder string
82 This option is supported for reading only.
83
84 Specify the scanline order of the input image. Possible values:
85 TopDown or BottomUp. Default is TopDown.
86
87 -gamma float
88 This option is supported for reading only.
89
90 Specify a gamma correction to be applied when mapping 16-bit
91 input data to 8-bit image values. Default is 1.0.
92
93 -min float
94 This option is supported for reading only.
95
96 Specify the minimum pixel value to be used for mapping 16-bit
97 input data to 8-bit image values. Default is the minimum value
98 found in the image data.
99
100 -max float
101 This option is supported for reading only.
102
103 Specify the maximum pixel value to be used for mapping 16-bit
104 input data to 8-bit image values. Default is the maximum value
105 found in the image data.
106
107 -ascii bool
108 This option is supported for writing only. If set to true, the
109 file is written in PPM 8-bit ASCII format (P3). Default is
110 false, i.e. write in PPM 8-bit binary format (P6).
111
113 img-bmp, img-dted, img-gif, img-ico, img-intro, img-jpeg, img-pcx, img-
114 pixmap, img-png, img-ppm, img-ps, img-raw, img-sgi, img-sun, img-tga,
115 img-tiff, img-window, img-xbm, img-xpm
116
118 image handling, ppm, tk
119
121 Copyright (c) 1995-2009 Jan Nijtmans <nijtmans@users.sourceforge.net>
122
123
124
125
126img-ppm 1.4 img-ppm(n)