Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_perl thread: Imager and Image::Magick


Message #1 by charles.hsiao@t... on Fri, 15 Feb 2002 22:11:55
I tried to blend two gif images into one using those two modules and did 
succeed. Can somebody tell me how to do it? Thanks a lot. The size of 
images are the same.

Charles

#!/usr/local/bin/perl -w
use Imager;

my $f1='tmp.gif';
my $f2='tmp1.gif';

my $img1 = Imager->new();
my $img2 = Imager->new();

$img1->open(file=>$f1,type=>'gif');
$img2->open(file=>$f2,type=>'gif');

$img1->rubthrough(img=>$img2);
$img1->write(file=>'a.gif',type=>'gif') || print "merge failed\n";;

undef $img1;
undef $img2;

  Return to Index