NAME

Image::TextMode::Renderer::GD - A GD-based renderer for text mode images

SYNOPSIS

    use Image::TextMode::Format::ANSI;
    use Image::TextMode::Renderer::GD;
    
    my $ansi = Image::TextMode::Format::ANSI->new;
    $ansi->read( $file );
    
    my $renderer = Image::TextMode::Renderer::GD->new;
    
    # render fullscale version
    print $renderer->fullscale( $ansi );
    
    # render thumnail version
    print $renderer->thumbnail( $ansi );

DESCRIPTION

This module allows you to render your text mode image though the GD graphics library.

METHODS

new( %args )

Creates a new instance.

thumbnail( $source, \%options )

Renders a thumbnail-sized version of the image. This is mostly a pass-through to fullscale() with the resulting image being scaled down to 1 pixel width per 1 character column. Options specific to this method are:

  • zoom - a zoom factor for the thumbnail (default: n/a)

See fullscale for all of the other available options.

fullscale( $source, \%options )

Renders a pixel-by-pixel representation of the text mode image. You may use the following options to change the output:

  • crop - limit the display to this many rows (default: no limit)

  • blink_mode - when false, use the 8th bit of an attribute byte as part of the background color (aka iCEColor) (default: differs by format)

  • truecolor - set this to true to enable true color image output (default: false)

  • 9th_bit - compatibility option to enable a ninth column in the font (default: false)

  • dos_aspect - emulate the aspect ratio from DOS (default: false)

  • ced - CED mode (black text on gray background) (default: false)

  • font - override the image font; either a font object, or the last part of the clas name (e.g. 8x8)

  • palette - override the image palette; either a palette object, or the last part of the class name (e.g. VGA)

  • format - the output format (default: png)

AUTHOR

Brian Cassidy <bricas@cpan.org>

COPYRIGHT AND LICENSE

Copyright 2008-2015 by Brian Cassidy

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