img-xbm(3tk)

πŸ“¦
version 2.1.1 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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:

  1. Image data in xbm format (that's the -data and -file options) gets detected automatically. no cap. πŸ”₯
  2. The format name xbm is recognized by the -format option.

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 version 2.0. if you set it to true, it prints extra info about the image being read or written to stdout. default is false. it's giving "tell me everything" energy πŸ—£οΈ
  • -foreground string β€” this one is supported for reading only, available since version 1.4.15. it sets the foreground color of the bitmap. the default value is black. the color string can be given in any format that Tk_GetColor accepts. πŸ–€
  • -background string β€” also supported for reading only, also available since version 1.4.15. it sets the background color of the bitmap. the default value is transparent ✨ (yes, transparent, we love a see-through moment). same deal: the color string can be in any format that Tk_GetColor accepts.

πŸ¦‹ 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


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