img-bmp(3tk)

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

πŸ’– 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?
  1. Image data in bmp format (the -data and -file options) is detected automatically. no cap. πŸ”₯
  2. The format name bmp is 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 πŸ“

  1. 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 to stdout. Default is false. 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. If yres isn't specified, it gets set to the value of xres. 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 (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