#!C:\Perl\bin\perl.exe =head1 NAME ans2png - Convert ansi files to png =head1 SYNOPSIS % ans2png [-t] [-f font.fnt] [-p My::Palette] [file.ans] > file.png =head1 DESCRIPTION This is a simple command-line tool to help you convert ansi files to png images. Use the -t switch to create a thumbnail. Use the -f switch to specify a GD font to use. Use -p to specify a custom palette class. Omitting the filename (or using '-') will force it to convert from STDIN. =cut use strict; use warnings; use Image::ANSI; use Getopt::Std; use Pod::Usage; our $VERSION = '0.01'; my %options; getopts( 'tf:p:', \%options ); my $file = shift; my $ansi; if( !$file or $file eq '-' ) { $ansi = Image::ANSI->new( handle => \*STDIN ); } else { $ansi = Image::ANSI->new( file => $file ); } binmode STDOUT; my %png = ( mode => $options{ t } ? 'thumbnail' : 'full', font => $options{ f } || undef, palette => $options{ p } || undef ); print $ansi->as_png( %png ); =head1 AUTHOR =over 4 =item * Brian Cassidy Ebricas@cpan.orgE =back =head1 COPYRIGHT AND LICENSE 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. =cut