Image::ANSIMation - Load, create, manipulate and save ANSI animation (ANSIMation) files


        use Image::ANSI::ANSIMation;

        # Read in a file...
        my $anim = Image::ANSIMation->new( file => 'file.ans' );

        # Image width and height
        my $w = $anim->width;
        my $h = $anim->height;

        # export it as a gif animation
        my $gif = $anim->as_gif;


This module allows you to load, create and manipulate files made up of ANSI escape codes, much like Image::ANSI, except that it can be composed of many frames creating an animation.


new( %options )

Creates a new ANSIMation. Currently only reads in data.

        # filename
        $anim = Image::ANSIMation->new( file => 'file.ans' );
        # file handle
        $anim = Image::ANSIMation->new( handle => $handle );

        # string
        $anim = Image::ANSIMation->new( string => $string );

read( %options )

Reads in ANSI data.

write( %options )

Writes the ANSI data to a file, filehandle or string.

as_string( %options )

Returns the ANSI output as a scalar.

add_frame( $frame )

Adds another frame to the animation

frames( )

Returns an array ref of frames.

current_frame( )

Returns an integer of the current position in the array of frames.

next_frame( )

Return the next frame in the sequence and add 1 to the current_frame.

width( )

Returns the width of the animation.

height( )

Returns the height of the animation.

as_gif( )

Return the animation as an animated gif.


  • Brian Cassidy <>


Copyright 2004-2009 by Brian Cassidy

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