use Image::Magick; my $image = Image::Magick->new(); $image->ReadImage( 'x.jpg' ); my $pic = Image::Magick->new(); $pic->ReadImage( 'x.gif' ); $pic->Scale( width=>$w, height=>$h ); $image->Composite( image=>$pic, x=>$x, y=>$y, compose=>'Over' ); $image->Write( 'xb.jpg' ); #### use Image; my $image = Imager->new; $image->read(file=>'x.jpg', type=>'jpeg') or die "Cannot read: ", $image->errstr; my $pic = Imager->new; $pic->read(file=>'x.gif', type=>'gif') or die "Cannot read: ", $pic->errstr; $image->paste( left=>$x, top=>$y, img=> $pic->scale( xpixels=>$w, ypixels=>$h, type=>'min' ), ); $image->write(file=>"xb.jpg");