Tcl Library Source Code


[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]


tiff - TIFF reading, writing, and querying and manipulation of meta data

Table Of Contents


package require Tcl 8.5 9
package require tiff ?0.2.1?

::tiff::isTIFF file
::tiff::byteOrder file
::tiff::numImages file
::tiff::dimensions file ?image?
::tiff::imageInfo file ?image?
::tiff::entries file ?image?
::tiff::getEntry file entry ?image?
::tiff::addEntry file entry ?image?
::tiff::deleteEntry file entry ?image?
::tiff::getImage file ?image?
::tiff::writeImage image file ?entry?
::tiff::nametotag names
::tiff::tagtoname tags
::tiff::debug file


This package provides commands to query, modify, read, and write TIFF images. TIFF stands for Tagged Image File Format and is a standard for lossless storage of photographical images and associated metadata. It is specified at

Multiple images may be stored in a single TIFF file. The ?image? options to the functions in this package are for accessing images other than the first. Data in a TIFF image is stored as a series of tags having a numerical value, which are represented in either a 4 digit hexadecimal format or a string name. For a reference on defined tags and their meanings see



The mapping of 4 digit tag names to string names uses the array ::tiff::tiff_tags. The reverse mapping uses the array ::tiff::tiff_sgat.


  1. Cannot write exif ifd

  2. Reading limited to uncompressed 8 bit rgb and 8 bit palletized images

  3. Writing limited to uncompressed 8 bit rgb

Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category tiff of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

When proposing code changes, please provide unified diffs, i.e the output of diff -u.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.


image, tif, tiff


File formats


Copyright © 2005-2006, Aaron Faupell