img-bmp(3tk)
π img-bmp β bestie's guide to the Windows bitmap format (bmp) π
okay so. you're here because you want Tk to eat .bmp files, and honestly? same. this is the img-bmp page from Img (manual section 3tk), and it's lowkey one of the chillest ones. let's go. β¨
π SYNOPSIS π
package require img::bmp ?2.1?
yes that ?2.1? is optional, she's flexible like that. π
πΈ DESCRIPTION πΈ
First things first, babe:
package require img::bmp
So here's the tea. Like all the packages in Img, this one does not hand you brand-new commands. Nope. Instead it extends the Tk command image that you already know and love, so that it can handle files holding raster images in the Windows bitmap format (bmp). More specifically, img::bmp extends Tk's photo image type.
(that's the photo image type, over at the Tcl man pages β you know the one, iykyk π«Ά)
The name of the new format handler is bmp. This handler brings new additional configuration options with it β go peek at the Options section for the full rundown, bestie.
And all of the above means that in a call like:
image create photo ?name? ?options?
- Image data in
bmpformat (the-dataand-fileoptions) is detected automatically. no cap. π₯ - The format name
bmpis recognized by the option-format.
On top of that, the value of the -format option is treated as a list, and it may contain any of the special options listed in the Options section. so you can stack them in there. cute.
The package img::bmp is a sub-package of Img. You can load it as part of the complete Img support:
package require Img
or on its own, like the independent main character she is:
package require img::bmp
π NOTES π
- Chapter Image Metadata of the Img manual page describes the parameters of the resolution related options. (so if you're confused about resolution stuff later, that's where the lore lives. π)
β¨ OPTIONS β¨
The handler provides the following options, and yes, we're doing all of them:
-verbose boolβ supported for reading and writing, and available since version 2.0. If you set it to true, extra info about the read or written image gets printed tostdout. Default isfalse. she's chatty when you let her be. π£οΈ-resolution xres ?yres?β supported for writing only, available since version 2.0. Heads up: an incompatible version of this option was introduced back in version 1.4.1 (ancient history, but be aware). This sets the resolution values of the written image file. Ifyresisn't specified, it gets set to the value ofxres. If the option isn't specified at all, then the DPI and aspect values of the metadata dictionary get written. And if there are no metadata values available? Then no resolution values are written. periodt. π-xresolution xresβ supported for writing only, available since version 2.0. Sets the horizontal resolution value of the written image file. π¦-yresolution yresβ supported for writing only, available since version 2.0. Sets the vertical resolution value of the written image file. π
π SEE ALSO π
go read these too, they're all iconic in their own way:
img, img-bmp, img-dted, img-flir, img-gif, img-ico, img-jpeg, img-pcx, img-pixmap, img-png, img-ppm, img-ps, img-raw, img-sgi, img-sun, img-tga, img-tiff, img-window, img-xbm, img-xpm
π COPYRIGHT π
- Copyright (c) 1995-2025 Jan Nijtmans <nijtmans@users.sourceforge.net>
- Copyright (c) 2002-2025 Andreas Kupries <andreas_kupries@users.sourceforge.net>
- Copyright (c) 2003-2025 Paul Obermeier <obermeier@users.sourceforge.net>
and that's the whole page, bestie!! π«Ά this was img-bmp, version 2.1, from the img-bmp(3tk) manual β go forth and decode those bitmaps, you absolute icon. ππβ¨
π¦ where this page comes from
- ubuntu resolute: libtk-img-doc 1:2.1.0+dfsg1-1 Β· Tcl
- ubuntu stonking: libtk-img-doc 1:2.1.1+dfsg1-2 Β· Tcl
- Copyright (c) 1995-2025 Jan Nijtmans <nijtmans@users\&.sourceforge\&.net>
- Copyright (c) 2002-2025 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- Copyright (c) 2003-2025 Paul Obermeier <obermeier@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms