Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Concatenating Images with Perl

by renodino (Curate)
on Dec 12, 2007 at 16:11 UTC ( [id://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

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-29 06:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found