.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "PDF::Builder::Resource::XObject::Image::PNG_IPL 3" .TH PDF::Builder::Resource::XObject::Image::PNG_IPL 3 2026-02-08 "perl v5.42.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME PDF::Builder::Resource::XObject::Image::PNG_IPL \- Support routines for PNG image library (using Image::PNG::Libpng) .PP Inherits from PDF::Builder::Resource::XObject::Image .SH METHODS .IX Header "METHODS" .SS new .IX Subsection "new" .Vb 1 \& $res = PDF::Builder::Resource::XObject::Image::PNG_IPL\->new($pdf, $file, %opts) .Ve .Sp .RS 4 Returns a PNG\-image object. \f(CW$pdf\fR is the PDF object being added to, \f(CW$file\fR is the input PNG file, and the optional \f(CW$name\fR of the new parent image object defaults to PxAAA. .Sp If the Image::PNG::Libpng package is installed, and its use is not suppressed via the \f(CW\*(C`nouseIPL\*(C'\fR flag (see Builder documentation for \f(CW\*(C`image_png\*(C'\fR), the PNG_IPL library will be used. Otherwise, the PNG library will be used instead. .Sp \&\fBopts:\fR .IP "\*(Aqnotrans\*(Aq => 1" 4 .IX Item "'notrans' => 1" No transparency \-\- ignore tRNS chunk if provided, ignore Alpha channel if provided. .IP "\*(Aqforce8bps\*(Aq => 1" 4 .IX Item "'force8bps' => 1" If the PNG source is 16bps, tell the libpng library to strip down all channels to 8bps, permitting use on PDF 1.4 output. .IP "\*(Aqname\*(Aq => \*(Aqstring\*(Aq" 4 .IX Item "'name' => 'string'" This is the name you can give for the PNG image object. The default is Pxnnnn. .RE .RS 4 .Sp Remember that you need to use Builder.pm\*(Aqs image_png to process PNG images. .RE .SS "Supported PNG types" .IX Subsection "Supported PNG types" .Vb 4 \& (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 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 for truecolor via palette + Alpha channel .Ve .PP In all cases, 16 bits per sample forces PDF 1.5 (or higher) output, unless you give the \f(CW\*(C`force8bps\*(C'\fR 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. .PP 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). .PP 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. .SS usesLib .IX Subsection "usesLib" .Vb 1 \& $mode = $png\->usesLib() .Ve .Sp .RS 4 Returns 1 if Image::PNG::Libpng installed and used, 0 if not installed, or \-1 if installed but not used (nouseIPL option given to \f(CW\*(C`image_png\*(C'\fR). .Sp \&\fBCaution:\fR this method can only be used \fIafter\fR the image object has been created. It can\*(Aqt 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 \fBLA_IPL()\fR call if you need to know in advance. .RE