Imager

 view release on metacpan or  search on metacpan

lib/Imager/Files.pod  view on Meta::CPAN

gif_colormap_size - the original size of the color map for the image.
The color map of the image may have been expanded to include out of
range color indexes.

=back

Where applicable, the ("name") is the name of that field from the C<GIF89>
standard.

The following GIF writing options are obsolete, you should set the
corresponding tag in the image, either by using the tags functions, or
by supplying the tag and value as options.

=over

=item *

gif_each_palette - Each image in the GIF file has it's own palette if
this is non-zero.  All but the first image has a local color table
(the first uses the global color table.

Use C<gif_local_map> in new code.

=item *

interlace - The images are written interlaced if this is non-zero.

Use C<gif_interlace> in new code.

=item *

gif_delays - A reference to an array containing the delays between
images, in 1/100 seconds.

Use C<gif_delay> in new code.

=item *

gif_positions - A reference to an array of references to arrays which
represent screen positions for each image.

New code should use the C<gif_left> and C<gif_top> tags.

=item *

gif_loop_count - If this is non-zero the Netscape loop extension block
is generated, which makes the animation of the images repeat.

This is currently unimplemented due to some limitations in C<giflib>.

=back

You can supply a C<page> parameter to the C<read()> method to read
some page other than the first.  The page is 0 based:

  # read the second image in the file
  $image->read(file=>"example.gif", page=>1)
    or die "Cannot read second page: ",$image->errstr,"\n";

Before release 0.46, Imager would read multiple image GIF image files
into a single image, overlaying each of the images onto the virtual
GIF screen.

As of 0.46 the default is to read the first image from the file, as if
called with C<< page => 0 >>.

You can return to the previous behavior by calling read with the
C<gif_consolidate> parameter set to a true value:

  $img->read(file=>$some_gif_file, gif_consolidate=>1);

As with the to_paletted() method, if you supply a colors parameter as
a reference to an array, this will be filled with Imager::Color
objects of the color table generated for the image file.

=head2 TIFF (Tagged Image File Format)

Imager can write images to either paletted or RGB TIFF images,
depending on the type of the source image.

When writing direct color images to TIFF the sample size of the
output file depends on the input:

=over

=item *

double/sample - written as 32-bit/sample TIFF

=item *

16-bit/sample - written as 16-bit/sample TIFF

=item *

8-bit/sample - written as 8-bit/sample TIFF

=back

For paletted images:

=over

=item *

C<< $img->is_bilevel >> is true - the image is written as bi-level

=item *

otherwise - image is written as paletted.

=back

If you are creating images for faxing you can set the I<class>
parameter set to C<fax>.  By default the image is written in fine
mode, but this can be overridden by setting the I<fax_fine> parameter
to zero.  Since a fax image is bi-level, Imager uses a threshold to
decide if a given pixel is black or white, based on a single channel.
For gray scale images channel 0 is used, for color images channel 1
(green) is used.  If you want more control over the conversion you can
use $img->to_paletted() to product a bi-level image.  This way you can



( run in 1.614 second using v1.01-cache-2.11-cpan-99c4e6809bf )