Little syntax problems

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
domx
Posts: 2
Joined: 2015-06-05T09:06:09-07:00
Authentication code: 6789
Location: Germany/Regensburg

Little syntax problems

Post by domx »

Sow... Hello guys. I haven't found helpful things via google, or the forum search, so I'll ask direktly

I've written a nice bash skript. Now I'm translating it to Perl. Most of this is no problem, but the API for PerlMagick gets me crazy...
I've tried the most of http://www.imagemagick.org/script/perl-magick.php for the things, but three things don't run... I'm very frustrated, after one and a half day searching and trying...

How to do these things with PerlMagick?

1st: convert -size ${1}x$2 xc:black +repage "$WDir/BG/image.png" # creates image.png, with black background and through variables set resolution

2nd: composite $1 -gravity Center +repage "$WDir/BG/image.png" $2 # creates $2, where $1 lays on image.png (Two layers combined)

3rd: convert ${hor[*]} +append +repage "$WDir/matrix/mat${Y}.png" # something like you can see here: http://php.net/manual/en/imagick.appendimages.php

Generally on the beginning:
my($image);
$image = Image::Magick->new;

Some things I already tried
1st: Sounds to me to create images, but don't work
$image->Montage(geometry=>'160x160', background=>'rgb(0,0,0)');
$image->Write('BG.png');

2nd: sounds all to be to do this. But if, I don't get the exact syntax
$image->Read("/home/dominik/Bilder/Wallpaper/BHZ/Biohazard-5.jpeg");
$image->Read("/home/dominik/Bilder/Wallpaper/BHZ/Biohazard-6.jpeg");
$image->Flatten(??); <- how to use?!
$image->Composite(compose=>'Add');
$image->Composite(compose=>'Atop');
$image->Write('x.png');

3rd: How to initialize it, to append these two side-by-side?
$image->Read("/home/dominik/Bilder/Wallpaper/BHZ/Biohazard-5.jpeg");
$image->Read("/home/dominik/Bilder/Wallpaper/BHZ/Biohazard-6.jpeg");
$image->Append('false');
$image->Write('APP.png');

Generally after:
undef($image);

All was also tried with Transform(); .
Post Reply