Documentation
A detailled description of all supported format options is available in the Reference Manual.
See the ChangeLog for Img 2.0.0 for a list of incompatible changes between Img versions 1 and 2.
Frequently asked questions
Img versions previous to version 2 returned image data as base64 encoded data for historical reasons.
Tk returns image data as binary string, which is faster and needs less memory. So Img version 2 now returns image data as binary string, too.
If you need the image data as base64 encoded string, use the
binary encode base64 command.
Tk 9.0.4 respects the color profile settings, so the output of the
-format window option returns slightly different values depending
on the used color profile (System settings->Displays->Color profile).
The following test script returns the values listed below:
package require Tk package require Img puts "Using Tk [package version Tk] and Img [package version Img]" canvas .c pack .c .c create rectangle 0 0 100 100 -fill "#0000FF" update idletasks set phImg [image create photo -format window -data .c] puts "Color: [$phImg get 10 10]"
Using Tk 8.6.18 or Tk 9.0.3:
Color: 0 0 255
Using Tk 9.0.4 and different color profiles:
Color: 0 0 245 (Display P3, Color-LCD)
Color: 0 0 250 (Adobe RGB)
Color: 0 0 255 (General RGB-Profile, Rec. ITU-R BT.709-5, sRGB IEC61966-2.1)