Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Concatenating Images with Perl

by renodino (Curate)
on Dec 12, 2007 at 16:11 UTC ( #656661=note: print w/ replies, xml ) Need Help??

in reply to Concatenating Images with Perl

If you mean "tile" images, GD::Tiler may be a smaller/simpler alternative to Image::Magick.

Perl Contrarian & SQL fanboy
Comment on Re: Concatenating Images with Perl
Replies are listed 'Best First'.
Re^2: Concatenating Images with Perl
by Anonymous Monk on Dec 13, 2007 at 15:46 UTC
    here's some code from an old program of mine that concatenates two images (image1 and image2.png):
    $tempimage = new Image::Magick; $tempimage->Read('image1.png'); $temppg = new Image::Magick; $temppg->Read('image2.png'); $temppg->Resize(width=>400, height=>351, filter=>Box); $temppg->Border(height=>8, outer=>5, color=>'#FFFFFF'); $temppg->Border(width=>1, height=>1, color=>'#000000'); $comp = new Image::Magick(size=>'710x410'); $comp->Read( 'xc:white' ); #i think this sets the background color $comp->Composite(image=>$tempimage, gravity=>'southeast'); #this dete +rmines where the image will be placed (southeast = bottom right) $comp->Composite(image=>$temppg, gravity=>'southwest'); $comp->Annotate(gravity=>'north', text=>substr($names[$curimage],0,100 +)); #adds a title at the top of the image $comp->Write('concatenated.png');
    hope that helps...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://656661]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2016-05-01 07:43 GMT
Find Nodes?
    Voting Booth?

    No recent polls found