img-tga(3tk)

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

πŸ’– NAME πŸ’–

okay so bestie, gather round β€” img-tga is the Truevision Targa format handler, aka plain ol' tga. that's it, that's the vibe. ✨


🌸 SYNOPSIS 🌸

package require img::tga ?2.1?

πŸ¦‹ DESCRIPTION πŸ¦‹

so first thing, you gotta do the little summoning ritual:

package require img::tga

now here's the tea: like every single package in Img, this one does not hand you any shiny new commands. nope! instead it extends the image command you already know and love from Tk, so that it can handle files holding raster images in the Truevision Targa format (tga). to be super specific about it, img::tga extends Tk's photo image type (yeah, [that one](https://www.tcl.tk/man/tcl9.0/TkCmd/photo.html), the photo image type). πŸ’…

the name of the new format handler is tga. this handler brings its own extra configuration options β€” peep the Options section for the full breakdown, no skimming bestie. πŸ‘€

and all of that ^ means that when you make a call like

image create photo ?name? ?options?

here's what happens:

  1. image data in tga format (that's the -data and -file options) gets detected automatically. it just knows. main character behavior fr fr. 🌟
  2. the format name tga is recognized by the -format option. πŸŽ€

plus β€” and this is the cute part β€” the value of the -format option is treated as a list, and it may contain any of the special options listed down in the Options section. so you can just... tuck them in there. iconic.

also important: the package img::tga is a sub-package of Img. you can load it as part of the whole complete Img support sitch:

package require Img

or you can load it all on its own, solo era:

package require img::tga

⭐ SUPPORTED TYPES ⭐

this format handler supports the following image types, bestie:

  • 24-bit pixels: Truecolor (RGB, 8-bit channels). 🌈
  • 32-bit pixels: Truecolor with alpha channel (RGBA, 8-bit channels). ✨

and all of those image types may be either uncompressed (Targa-Type 2) or run-length encoded (Targa-Type 10). two flavors, both slay. πŸ”₯


πŸ‘‘ OPTIONS πŸ‘‘

the handler provides the following options:

  • -verbose bool β€” supported for reading and writing, available since version 1.3. if you set it to true, extra info about the image you just read or wrote gets printed to stdout. default is false. πŸ—£οΈ
  • -withalpha bool β€” supported for reading and writing, available since version 1.3. if you set it to false, the alpha channel is ignored while reading or writing. default is true. πŸ’…
heads up bestie: this option used to be called -matte in previous versions, and that old name is still recognized. so if you see -matte out in the wild, don't panic, it's the same thing. πŸ™ˆ
  • -compression string β€” supported for writing only, available since version 1.3. set the compression mode to either none or rle. default is rle. πŸŽ€

πŸ’€ SEE ALSO πŸ’€

go read these too, they're all in the family:

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-tga, version 2.1, living its img-tga(3tk) life. go forth and decode some Targas, ily πŸ’–βœ¨

πŸ“¦ where this page comes from