PDF::Bu...:TIFF_GT(3)
β¨ PDF::Builder::Resource::XObject::Image::TIFF_GT β¨
TIFF image support (Graphics::TIFF enabled) π
okay so bestie, this is the TIFF_GT page from the PDF::Builder Perl docs (user-contributed, obviously, we're all just vibing in here) π¦
Inherits from <code>PDF::Builder::Resource::XObject::Image</code> β so it's got the family genes, periodt. π
πΈ METHODS πΈ
π new π
$res = PDF::Builder::Resource::XObject::Image::TIFF_GT->new($pdf, $file, %opts)
Returns a TIFF-image object, bestie. β¨ Here's the breakdown:
$pdfis the PDF object being added to$fileis the input TIFF file- and the optional
$nameof the new parent image object defaults to <code>IxAAA</code>
If the Graphics::TIFF package is installed, and its use is not suppressed via the <code>"nouseGT"</code> flag (peep the Builder documentation for <code>"image_tiff"</code>), the TIFF_GT library will be used. Otherwise? The TIFF library gets used instead. no cap. π«Ά
Options:
- <code>'notrans' => 1</code> β Ignore any alpha layer (transparency) and make the image fully opaque. bye bye transparency π
- <code>'name' => 'string'</code> β This is the name you can give for the TIFF image object. The default is <code>Ixnnnn</code>.
TIFF support (when using Graphics::TIFF) is for <code>"PhotometricInterpretation"</code> values of:
- 0 (bilevel/gray, white is 0)
- 1 (bilevel/gray, black is 0)
- 2 (RGB)
- 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 <code>PlanarConfiguration</code> of <code>2</code> is unknown until we get some test cases. it's giving "we'll figure it out when someone sends us a file" π§
Some applications seem to take odd liberties with TIFF tags, such as adding a <code>SamplePerPixel</code> without specifying <code>ExtraSamples</code> type. In such cases, we treat one extra sample (not otherwise defined) as an Alpha channel, and hope for the best! π (manifesting, honestly)
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 <code>Graphic::TIFF</code>'s owner (ticket <code>RT 133955</code>), this is coming directly from <code>libtiff</code> (as write to <code>STDERR</code>), so he can't do anything about it! π
ngl bestie, that warning dialog situation is not it, but it's out of our hands fr fr.
Finally, while Graphics::TIFF does not directly support passing in a filehandle (usually a <code>GLOB</code>), 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! β οΈ like, watch your disk space, girl.
π usesLib π
$mode = $tif->usesLib()
Returns:
1if Graphics::TIFF installed and used0if not installed-1if installed but not used (<code>nouseGT</code> option given to <code>"image_tiff"</code>)
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 <code>LA_GT()</code> call if you need to know in advance. π
okay that's the whole page bestie, you ate it, go make some gorgeous TIFFs πβ¨ππ¦πΈπ π«Ά
this iconic little manual page is <code>perl v5.42.0</code>, dated <code>2026-01-17</code>, and it lives in the <code>PDF::Bu...:TIFF_GT(3)</code> section of the User Contributed Perl Documentation. mwah π
π¦ where this page comes from
- fedora 44: perl-PDF-Builder 3.028-2.fc44 Β· LGPL-2.1-or-later AND LGPL-2.1-only AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms