img-jpeg(3tk)
β¨ img-jpeg β bestie's guide to the Joint Picture Expert Group format (jpeg) β¨
okay so picture this: it's a 3tk manual page, it lives in the Img family, and its whole personality is JPEG. that's the vibe. we're so back. π
π¦ SYNOPSIS π¦
package require img::jpeg ?2.1?
that's it. that's the whole summoning ritual. ?2.1? is optional, it's giving "if you know, you know." π
πΈ DESCRIPTION πΈ
package require img::jpeg
so here's the tea, bestie: just like every single package in Img, this one does not invent new commands. nope. not its style. instead it extends Tk's existing image command so that it can handle files full of raster images in the Joint Picture Expert Group format (jpeg). more specifically, img::jpeg extends Tk's photo image type (the docs for which live over at https://www.tcl.tk/man/tcl9.0/TkCmd/photo.html).
the name of the new format handler is jpeg. this handler brings new additional configuration options to the table β the deets are all down in the Options section. π
all of the above basically means that in a call like
image create photo ?name? ?options?
- image data in jpeg format (options
-dataand-file) is detected automatically. no cap. it just knows. π₯ - the format name
jpegis recognized by the option-format.
and wait, there's more: the value of option -format is treated as a list, and it may contain any of the special options listed down in section Options. iconique behavior honestly.
also the img::jpeg package is a sub-package of Img. so you can load it as part of the complete Img support, via package require Img, or you can load it all on its own, via package require img::jpeg. your call, main character. β¨
π NOTES π
- Chapter Image Metadata of the Img manual page describes the parameters of the resolution related options. (yes, go read that one too, it's a whole thing.) π
π OPTIONS π
the handler provides the following options, and we are listing all of them, periodt:
-verbose boolβ supported for reading and writing. available since version 2.0. if you set it totrue, extra info about the read or written image gets printed tostdout. default isfalse. it's giving "tell me everything, I want the lore." π«Ά-fastβ supported for reading only. available since version 1.2.4. if you specify it, it turns on a processing mode that's fast, but it only gives you low-quality information. speed over substance, we respect it. π-grayscaleβ supported for reading and writing. available since version 1.2.4. using this option forces incoming images to grayscale, and written images will come out monochrome. it's monochrome era. π€ (well, technically grayscale, but you get me.)-optimizeβ supported for writing only. available since version 1.2.4. if specified, it makes the writer optimize the Huffman table used to encode the JPEG coefficients. optimized queen behavior. π-progressiveβ supported for writing only. available since version 1.2.4. if specified, it causes the creation of a progressive JPEG file. fancy. β¨-quality nβ supported for writing only. available since version 1.2.4. this one specifies the compression level as a quality percentage. the higher the quality, the less the compression. the nominal range fornis0...100. useful values live in the range5...95. the default value is75. π-smooth nβ supported for writing only. available since version 1.2.4. when you use it, the writer will smooth the image before performing the compression. values in the10...30are usually enough. the default is0, i.e. no smoothing. no filter, no problem. π§-resolution xres ?yres?β supported for writing only. available since version 2.0. sets the resolution values of the written image file. ifyresisn't specified, it gets set to the value ofxres. if the option is not specified, the DPI and aspect values of the metadata dictionary are written instead. and if no metadata values are available, then no resolution values are written at all. that's the whole chain of events, fr fr. π¦-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 π
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
(yes, img-jpeg is in there too. it's referencing itself. self-love. we love to see it.) ππ
π 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-jpeg, version 2.1, from the Img source, and the page itself is img-jpeg(3tk). go forth and decode some JPEGs, you absolute icon. π«ΆπΈβ¨
π¦ 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