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

App::MathImage::Image::Base::Magick -- draw images using Image Magick

SYNOPSIS

 use App::MathImage::Image::Base::Magick;
 my $image = App::MathImage::Image::Base::Magick->new (-width => 100,
                                                       -height => 100);
 $image->rectangle (0,0, 99,99, 'white');
 $image->xy (20,20, 'black');
 $image->line (50,50, 70,70, '#FF00FF');
 $image->line (50,50, 70,70, '#0000AAAA9999');
 $image->save ('/some/filename.png');

CLASS HIERARCHY

App::MathImage::Image::Base::Magick is a subclass of Image::Base,

    Image::Base
      App::MathImage::Image::Base::Magick

DESCRIPTION

App::MathImage::Image::Base::Magick extends Image::Base to create or update image files using the Image::Magick module.

By default ImageMagick uses "anti-aliasing" to blur the edges of lines etc drawn. This is unlike the other Image::Base modules but currently it's not changed or overridden in the methods here. Perhaps in the future that will change.

Colour names are anything recognised by ImageMagick, as described under "Color Names" in its documentation. It has several RGB and other colour model forms, and a table of names roughly per X11 plus a config/colors.xml for extras.

FUNCTIONS

$image = App::MathImage::Image::Base::Magick->new (key=>value,...)

Create and return a new image object. A new image can be started with -width and -height,

    $image = App::MathImage::Image::Base::Magick->new (-width => 200, -height => 100);

Or an existing file can be read,

    $image = App::MathImage::Image::Base::Magick->new (-file => '/some/filename.png');

Or an Image::Magick object can be given,

    $image = App::MathImage::Image::Base::Magick->new (-imagemagick => $mobj);

ATTRIBUTES

-width (integer)
-height (integer)

Setting these changes the size of the image.

-imagemagick

The underlying Image::Magick object.

SEE ALSO

Image::Base, Image::Base::GD, Image::Base::PNGwriter, Image::Magick, Image::Xbm, Image::Xpm, Image::Pbm