simplest montage
Posted: 2011-05-31T14:37:37-07:00
I'm trying to recreate the following command line with PerlMagick (from http://www.imagemagick.org/Usage/montage/#montage)
I would have thought that the following would be a PerlMagick recreation of it:
However, this code does not work:
This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
ImageMagick 6.5.7-8 2010-12-02 Q16
PerlMagick 7:6.5.7.8-1ubuntu1
Code: Select all
montage balloon.gif medical.gif present.gif shading.gif montage.jpg
Code: Select all
#!/usr/bin/env perl
use strict;
use Cwd;
use Image::Magick;
sub montage {
my $cwd = getcwd();
my $montage = new Image::Magick;
$montage -> Read($_[0], $_[1]);
my $filename = sprintf "%s/my_montage", $cwd;
$montage -> Montage();
$montage -> Write($filename);
}
&montage($ARGV[0], $ARGV[1]);
- it produces an image called my_montage-0 instead of my_montage
- it doesn't produce a the image that (pseudocode) montage $ARGV[0] $ARGV[1] my_montage would have produced on the command line
This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
ImageMagick 6.5.7-8 2010-12-02 Q16
PerlMagick 7:6.5.7.8-1ubuntu1