.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" 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 .\" ======================================================================== .\" .IX Title "PDF::Builder::Resource::XObject::Image::PNG 3" .TH PDF::Builder::Resource::XObject::Image::PNG 3 2023-12-21 "perl v5.38.1" "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 \- support routines for PNG image library (using pure Perl code). 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\->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, the PNG_IPL library will be used instead of the PNG library. In such a case, use of the PNG library may be forced via the \f(CW\*(C`nouseIPL\*(C'\fR flag (see Builder documentation for \f(CWimage_png()\fR). .Sp \&\fBopts:\fR .IP "'notrans' => 1" 4 .IX Item "'notrans' => 1" No transparency \-\- ignore tRNS chunk if provided, ignore Alpha channel if provided. .IP "'name' => 'string'" 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 invoke the image_png method from Builder.pm in order to use this functionality. .RE .SS "Supported PNG types" .IX Subsection "Supported PNG types" .Vb 5 \& (0) Gray scale of depth 1, 2, 4, or 8 bits per pixel (2, 4, 16, or 256 \& gray levels). 16 bpp is not currently supported (a PNG with 16 bpp \& is a fatal error). Full transparency (of one 8\-bit gray value) via \& the tRNS chunk is allowed, unless the notrans option specifies \& that it be ignored. \& \& (2) RGB 24\-bit truecolor with 8 bits per sample (16.7 million colors). \& 16 bps is not currently supported (a PNG with 16 bps is a fatal \& error). Full transparency (of one 3x8\-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 bits per pixel plus 8\-bit Alpha channel (256 \& gray levels and 256 levels of transparency). 16 bpp is not \& currently supported (a PNG with 16 bpp is a fatal error). The Alpha \& channel is ignored if the notrans option is given. The tRNS chunk \& is not permitted. \& \& (6) RGB 24\-bit truecolor with 8 bits per sample (16.7 million colors) \& plus 8\-bit Alpha channel (256 levels of transparency). 16 bps is not \& currently supported (a PNG with 16 bps is a fatal error). The Alpha \& channel is ignored if the notrans option is given. The tRNS chunk \& is not permitted. .Ve .PP In all cases, 16 bits per sample are not implemented. A fatal error will be returned if a PNG image with 16\-bps data is supplied. The code is assuming standard "network" bit ordering (Big Endian). Interlaced (progressive) display images are not supported. Use the PNG_IPL version if you need to support 16 bps or interlaced images. .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. Certain filters and compressions applied to data will be handled, but 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'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 \fBLA_IPL()\fR call if you need to know in advance. .RE