---
name: "PDF::Builder::Resource::XObject::Image::TIFF_GT"
section: "3pm"
platform: "linux"
package: "perl-pdf-builder"
version: "3.028-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/PDF::Builder::Resource::XObject::Image::TIFF_GT"
---

# PDF::Builder::Resource::XObject::Image::TIFF\_GT(3pm)

TIFF image support (Graphics::TIFF enabled) Inherits from PDF::Builder::Resource::XObject::Image

## NAME

PDF::Builder::Resource::XObject::Image::TIFF\_GT - TIFF image support (Graphics::TIFF enabled)

Inherits from PDF::Builder::Resource::XObject::Image

## METHODS

### new

```
    $res = PDF::Builder::Resource::XObject::Image::TIFF_GT->new($pdf, $file, %opts)
```

Returns a TIFF-image object. `$pdf` is the PDF object being added to, `$file` is the input TIFF file, and the optional `$name` of the new parent image object defaults to IxAAA.

If the Graphics::TIFF package is installed, and its use is not suppressed via the `"nouseGT"` flag (see Builder documentation for `"image_tiff"`), the TIFF\_GT library will be used. Otherwise, the TIFF library will be used instead.

Options:

- 'notrans' =\> 1

  Ignore any alpha layer (transparency) and make the image fully opaque.

- 'name' =\> 'string'

  This is the name you can give for the TIFF image object. The default is Ixnnnn.

TIFF support (when using Graphics::TIFF) is for `"PhotometricInterpretation"` values of 0 (bilevel/gray, white is 0), 1 (bilevel/gray, black is 0), 2 (RGB), and 3 (Palette color). It currently does *not* support 4 (transparency mask), 5 (separated CMYK), 6 (YCbCr), 8 (CIELab), or higher. There is limited support  for an Alpha (transparency) channel (due to extremely limited test cases).  Some tags are not supported, and a PlanarConfiguration of 2 is unknown until  we get some test cases.

Some applications seem to take odd liberties with TIFF tags, such as adding a SamplePerPixel without specifying ExtraSamples type. In such cases, we treat one extra sample (not otherwise defined) as an Alpha channel, and hope for  the best!

If there are invalid tags or field values within a tag, the Graphics::TIFF library will attempt to pop-up a warning dialog, rather than just ignoring  invalid things. If we can find a switch to disable this behavior, we will look into adding it as an option. According to Graphic::TIFF's owner  (ticket RT 133955), this is coming directly from libtiff (as write to STDERR),  so he can't do anything about it!

Finally, while Graphics::TIFF does not directly support passing in a filehandle (usually a GLOB), PDF::Builder will attempt to detect this issue and write the content (from the filehandle) to a temporary file, and pass that in as a normal file. Some operating systems appear to have trouble erasing this temporary file, so be aware that such files may build up over time!

### usesLib

```
    $mode = $tif->usesLib()
```

Returns 1 if Graphics::TIFF installed and used, 0 if not installed, or -1 if installed but not used (nouseGT option given to `"image_tiff"`).

**Caution:** this method can only be used *after* the image object has been created. It can't tell you whether Graphics::TIFF is available in advance of actually using it, in case you want to use some functionality available only in TIFF\_GT. See the PDF::Builder **LA\_GT()** call if you need to know in advance.
