Imager::Montage - montage images
Version 0.01
# Generate a montage image. use Imager::Montage; my $im = Imager::Montage->new; my @imgs = <*.png>; my $page = $im->gen_page( { files => \@imgs, geometry_w => 200, # geometry from source. if not set , the resize_w , resize_h will be the default geometry_h => 200, # if we aren't going to resize the source images , we should specify the geometry at least. cols => 5, rows => 5, } ); $page->write( file => 'page.png' , type => 'png' ); # generate a 1000x1000 pixels image with 5x5 tiles
return a Imager object
$imager = $self->_load_image( $filename );
Return Imager::Font
my $font = _load_font( { file => '/path/to/font.ttf' , color => '#000000' , size => 72 } );
return Imager::Color
$self->_load_color( '#000000' );
montage your source image . it will return an Imager Object.
my $page = $im->gen_page( { files => \@imgs, resize_w => 100, resize_h => 100, cols => 3, rows => 3, margin_v => 5, margin_h => 5, page_width => 800, page_height => 600, background_color => '#ffffff', flip => 'h', # horizontal flip flip_exclude => ' return $file =~ m/d\d+.png/ ' , # don't flip files named \d+.png ( optional ) frame => 4, # ( optional ) frame_color => '#000000', border => 4, border_color => '#000000', res => 600, } );
Parameters:
files: an array contains filenames
background_color: background color of output image
geometry_h, geometry_w: geometry from source. if not set , the resize_w , resize_h will be the default
resize_w, resize_h): if it's given , montage will resize your source image to this size
cols, rows: tiles
margin_v,margin_h: margin for each image
page_width, page_height: the output image width & height
flip: do flip to each source image
flip_exclude
frame: frame width (optional)
frame_color: frame color (optional)
border: border width for each image (optional)
border_color: border color (optional)
res: resolution , default resolution is 600 (optional)
default resolution is 600 dpi
$self->_set_resolution( $filename , 600 ); $self->_set_resolution( $imager );
Cornelius, <c9s at aiink.com>
<c9s at aiink.com>
Please report any bugs or feature requests to bug-imager-montage at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Imager-Montage. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-imager-montage at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Imager::Montage
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Imager-Montage
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Imager-Montage
CPAN Ratings
http://cpanratings.perl.org/d/Imager-Montage
Search CPAN
http://search.cpan.org/dist/Imager-Montage
Copyright 2007 Cornelius, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Imager::Montage, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Imager::Montage
CPAN shell
perl -MCPAN -e shell install Imager::Montage
For more information on module installation, please visit the detailed CPAN module installation guide.