img-xbm(3tk)
π img-xbm β the X Windows Bitmap format (xbm) π
okay bestie, so this is the img-xbm page from the Img manual (section 3tk), and it's literally just the glow-up guide for reading and writing X Windows Bitmap files in Tk. let's get into it π
β¨ SYNOPSIS β¨
package require img::xbm ?2.1?
πΈ DESCRIPTION πΈ
so first things first, you load it up with:
package require img::xbm
and here's the tea: like every single package in Img, this one does not give you any shiny new commands of its own. nope. instead it extends the Tk command image that you already have, so that it can handle files holding raster images in the X Windows Bitmap format (aka xbm). more specifically, img::xbm extends Tk's photo image type (the docs for that live at https://www.tcl.tk/man/tcl9.0/TkCmd/photo.html if you wanna peek π).
the name of this new format handler is xbm. and this handler brings some brand-new extra configuration options to the table β check the Options section below for the full rundown, bestie.
all of that means that when you make a call like:
image create photo ?name? ?options?
here's what's going on:
- Image data in
xbmformat (that's the-dataand-fileoptions) gets detected automatically. no cap. π₯ - The format name
xbmis recognized by the-formatoption.
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. multi-tasking queen behavior π
also, the package img::xbm is a sub-package of Img. you can load it as part of the whole complete Img support via:
package require Img
or you can load it all on its own, main-character style, via:
package require img::xbm
π OPTIONS π
the handler provides these options, bestie β memorize them, they're iconic:
-verbose boolβ this one works for reading and writing, and it's been available since version2.0. if you set it totrue, it prints extra info about the image being read or written tostdout. default isfalse. it's giving "tell me everything" energy π£οΈ-foreground stringβ this one is supported for reading only, available since version1.4.15. it sets the foreground color of the bitmap. the default value isblack. the color string can be given in any format thatTk_GetColoraccepts. π€-background stringβ also supported for reading only, also available since version1.4.15. it sets the background color of the bitmap. the default value istransparentβ¨ (yes, transparent, we love a see-through moment). same deal: the color string can be in any format thatTk_GetColoraccepts.
π¦ SEE ALSO π¦
go check out the whole friend group, they're all slaying 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 π
these absolute legends made it happen:
- 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-xbm at version 2.1, part of the Img documentation in section 3tk. go forth and bitmap responsibly π
πβ
π¦ 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