img-tga(3tk)
π 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:
- image data in
tgaformat (that's the-dataand-fileoptions) gets detected automatically. it just knows. main character behavior fr fr. π - the format name
tgais recognized by the-formatoption. π
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 version1.3. if you set it to true, extra info about the image you just read or wrote gets printed tostdout. default isfalse. π£οΈ-withalpha boolβ supported for reading and writing, available since version1.3. if you set it to false, the alpha channel is ignored while reading or writing. default istrue. π
heads up bestie: this option used to be called-mattein previous versions, and that old name is still recognized. so if you see-matteout in the wild, don't panic, it's the same thing. π
-compression stringβ supported for writing only, available since version1.3. set the compression mode to eithernoneorrle. default isrle. π
π 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 π«Ά
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
- 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