1img-png(n) Img img-png(n)
2
3
4
5______________________________________________________________________________
6
8 img-png - Img, Portable Network Graphics format (png)
9
11 package require Tk
12
13 package require img::png ?1.4?
14
15 image create photo ?name? ?options?
16
17______________________________________________________________________________
18
20 The package img::png 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::png.
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 Network Graphics format (png). More
27 specifically img::png extends Tk's photo image type.
28
29 The name of the new format handler is png. This handler provides new
30 additional configuration options. See section PNG OPTIONS for more de‐
31 tailed 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 png format (options -data and -file) is detected
38 automatically.
39
40 [2] The format name png 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 PNG OPTIONS.
43
45 The handler provides the following options:
46
47 -verbose bool
48 This option is supported for reading only.
49
50 If set to true, additional information about the file format is
51 printed to stdout. Default is false.
52
53 -gamma float
54 This option is supported for reading only.
55
56 Use the specified gamma value when reading an image. This op‐
57 tion overwrites gamma values specified in the file. If this op‐
58 tion is not specified and no gamma value is in the file, a de‐
59 fault value of 1.0 is used.
60
61 -matte bool
62 This option is supported for reading only.
63
64 If set to false, a matte (alpha) channel is ignored during read‐
65 ing or writing. Default is true.
66
67 -alpha float
68 This option is supported for reading only.
69
70 An additional alpha filtering for the overall image, which al‐
71 lows the background on which the image is displayed to show
72 through. This usually also has the effect of desaturating the
73 image. The alphaValue must be between 0.0 and 1.0. Specifying
74 an alpha value, overrides the setting of the matte flag, i.e.
75 reading a file which has no alpha channel (Greyscale, RGB) will
76 add an alpha channel to the image independent of the matte flag
77 setting.
78
79 The handler provides no true write options at all, but accepts pairs of
80 keys and values when writing a PNG file. Each pair will be written as a
81 named text chunk where the key provides the name of the chunk and the
82 value its contents. For example
83
84
85 png Author <name> Title <title> Description ...
86
87
89 If you want to write images to disk which contain transparency informa‐
90 tion (e.g. PNG with alpha channel) you need at least Tk 8.3.
91
93 img-bmp, img-dted, img-gif, img-ico, img-intro, img-jpeg, img-pcx, img-
94 pixmap, img-png, img-ppm, img-ps, img-raw, img-sgi, img-sun, img-tga,
95 img-tiff, img-window, img-xbm, img-xpm
96
98 image handling, png, tk
99
101 Copyright (c) 1995-2009 Jan Nijtmans <nijtmans@users.sourceforge.net>
102
103
104
105
106img-png 1.4 img-png(n)