Can you say what might be missing? Thank you.
Code: Select all
#!/usr/bin/perl
use strict;
use Image::Magick;
my $imageblue = Image::Magick->new;
$imageblue->Set('size'=>'50x50');
$imageblue->ReadImage('xc:blue');
$imageblue->Write('win:'); #or 'show:'
$imageblue->Write('SourceBLUE.png');
my $imagered = Image::Magick->new;
$imagered->Set('size'=>'50x50');
$imagered->ReadImage('xc:red');
$imagered->Write('win:'); #or 'show:'
$imagered->Write('SourceRED.png');
my $imagewhite = Image::Magick->new;
$imagewhite->Set('size'=>'50x50');
$imagewhite->ReadImage('xc:white');
$imagewhite->Write('win:'); #or 'show:'
$imagewhite->Write('TargetWHITE.png');
# read red top paste white top
$imagewhite->CopyPixels($imagered,geometry=>'50x25+0+0',dx=>0,dy=>0); # SYNTAX: missing 'image=>' before $imagered
# read blue top paste white bottom
$imagewhite->CopyPixels($imageblue,geometry=>'50x25+0+0',dx=>0,dy=>25); # Ditto
$imagewhite->Write('win:'); #or 'show:'
$imagewhite->Write('TargetREDBLUE.png');