The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Imager::GIF - a handy module for animated GIF processing

VERSION

version 0.002

SYNOPSIS

my $sonic = Imager::GIF->new(file => 'sonic.gif');
my $small_sonic = $sonic->scale(scalefactor => 0.5);
$small_sonic->write(file => 'small_sonic.gif');

DESCRIPTION

This module will attempt to Do The Right Things regarding transformations on animated gifs.

Imager, as compared to Imagemagick is far less magical; animated gifs aren't treated in any special way, they're just the sequence of ordinary images. In order to perform any transformation on them (scaling etc.) one has to transform all the images separately. Besides, transforming images removes all the metadata from them, which breaks animated gifs even more. This module attempts to fix it and make it easy to transform animated gifs without breaking them.

METHODS

new(@images) (class method)

Create a new Imager::GIF object from a sequence of images. One would probably want to use read method instead.

read(file => $filename) (class method)

Reads an animated gif from the specified location, returns a newly created Imager::GIF object.

write(file => $filename)

Writes the invocant object to a speficied file.

scale()

Works exactly like Imager-scale>, but does the right thing for animated gifs.

TODO

Implement the rest of the transformations (cropping, rotating etc).

CAVEATS

scale(), given some weird combination of xpixels and/or ypixels may produce funny-looking images. Using scalefactor is usually safer.

AUTHOR

Tadeusz Sośnierz <tsosnierz@opera.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Opera Software ASA.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 140:

Non-ASCII character seen before =encoding in 'Sośnierz'. Assuming UTF-8