The goal posts will always move quicker than you can.
— admiree2, Calvin and Hobbes comic letters
PDF::Builder::Resource::XObject::Image::PNG_IPL - Support routines for PNG image library (using Image::PNG::Libpng)
Inherits from PDF::Builder::Resource::XObject::Image
$res = PDF::Builder::Resource::XObject::Image::PNG_IPL->new($pdf, $file, %opts)
Returns a PNG-image object.$file
is the input PNG file, and the optional$name
of the new parent image object defaults to PxAAA.
If the Image::PNG::Libpng package is installed, and its use is not suppressed via thenouseIPL
flag (see Builder documentation forimage_png
), the PNG_IPL library will be used. Otherwise, the PNG library will be used instead.
opts:
No transparency -- ignore tRNS chunk if provided, ignore Alpha channel if provided.
If the PNG source is 16bps, tell the libpng library to strip down all channels to 8bps, permitting use on PDF 1.4 output.
This is the name you can give for the PNG image object. The default is Pxnnnn.
Remember that you need to use Builder.pm's image_png to process PNG images.
(0) Gray scale of depth 1, 2, 4, 8, or 16 bits per pixel (2, 4, 16, 256,
or 65536 gray levels). Full transparency (of one 16-bit gray value)
via the tRNS chunk is allowed, unless the notrans option specifies
that it be ignored.
(2) RGB truecolor with 8 or 16 bits per sample (3 samples: 16.7 million
or 281.5 trillion colors). Full transparency (of one 3x16-bit RGB
color value) via the tRNS chunk is allowed, unless the notrans
option specifies that it be ignored.
(3) Palette color with 1, 2, 4, or 8 bits per pixel (2, 4, 16, or 256
color table/palette entries). 16 bpp is not currently supported by
PNG or PDF. Partial transparency (8-bit Alpha) for each palette
entry via the tRNS chunk is allowed, unless the notrans option
specifies that it be ignored (all entries fully opaque).
(4) Gray scale of depth 8 or 16 bits per pixel plus equal-sized Alpha
channel (256 or 65536 gray levels and 256 or 65536 levels of
transparency). The Alpha channel is ignored if the notrans
option is given. The tRNS chunk is not permitted.
(5) B<RESERVED> for grayscale via palette + Alpha channel
(6) RGB truecolor with 8 or 16 bits per sample, with equal-sized
Alpha channel (256 or 65536 levels of transparency). The Alpha
channel is ignored if the notrans option is given. The tRNS
chunk is not permitted.
(7) B<RESERVED> for truecolor via palette + Alpha channel
In all cases, 16 bits per sample forces PDF 1.5 (or higher) output, unless you give the force8bps
option, to "strip" 16 bit samples to 8 bits, and permit PDF 1.4-compatible output. The libpng.a library is assuming standard "network" bit and byte ordering (Big Endian), although flags might be added to change this.
The transparency chunk (tRNS) will specify one gray level entry or one RGB entry to be treated as transparent (Alpha = 0). For palette color, up to 256 palette entry 8-bit Alpha values are specified (256 levels of transparency, from 0 = transparent to 255 = opaque).
Only a limited number of chunks are handled: IHDR, IDAT (internally), PLTE, tRNS, and IEND (internally). All other chunks are ignored at this time. Filters and compression applied to data is handled internally by libpng.a -- there may be unsupported methods.
$mode = $png->usesLib()
Returns 1 if Image::PNG::Libpng installed and used, 0 if not installed, or -1 if installed but not used (nouseIPL option given to image_png
).
Caution: this method can only be used after the image object has been created. It can't tell you whether Image::PNG::Libpng is available in advance of actually using it, in case you want to use some functionality available only in PNG_IPL. See the PDF::Builder LA_IPL() call if you need to know in advance.
Master Index
PDF::Builder -- Facilitates the creation and modification of PDF files
PDF::Builder::Resource -- Base class for PDF resources
PDF::Builder::Resource::XObject -- Base class for external objects
PDF::Builder::Resource::XObject::Image -- Base class for external raster image objects
PDF::Builder::Resource::XObject::Image::GD -- Support routines for Graphics Development image library
PDF::Builder::Resource::XObject::Image::GIF -- Support routines for GIF image library
PDF::Builder::Resource::XObject::Image::JPEG -- Support routines for JPEG image library
PDF::Builder::Resource::XObject::Image::PNG -- Support routines for PNG image library (using pure Perl code)
PDF::Builder::Resource::XObject::Image::PNM -- Support routines for PNM (Portable aNy Map) image library
PDF::Builder::Resource::XObject::Image::SVG -- Support routines for SVG (Scalable Vector Graphics) image library
PDF::Builder::Resource::XObject::Image::TIFF -- TIFF image support
PDF::Builder::Resource::XObject::Image::TIFF_GT -- TIFF image support (Graphics::TIFF enabled)
All content © copyright 2005 – 2025
by Catskill Technology Services, LLC.
All rights reserved.
Note that Third Party software (whether Open Source or proprietary) on this
site remains under the copyright and license of its owners.
Catskill Technology Services, LLC does not claim copyright over such software.
This page is https://www.catskilltech.com/Documentation/PDF/Builder/Resource/XObject/Image/PNG_IPL.html
Search Quotations database.
Last updated Sat, 19 Apr 2025 at 8:16 PM