Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

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
Node Status?
node history
Node Type: note [id://656661]
help
Chatterbox?
[Tanktalus]: What's so happy about it? :P
[Tanktalus]: ww: your parens don't line up. Sure, perl can look like line noise, but the parens still have to line up. ;)
[Tux]: 1nickt did you build 5.24.3, 5.26.1, and 5.27.4 yet?
Tux now has 284 working versions of perl
[1nickt]: Tux oh yes, have filed reports from them already :-)
1nickt has 44 for one version of one OS ...
[Tux]: good boy :)
[1nickt]: Had to beat on things for a bit to get cpanminus working on 5.8.9, and it just would not go on 5.6.2, so I abndoned that one for cpanm-reporter work. I mean realistically how many people are using 5.6.2 on OS X ? :-/

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2017-09-25 16:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (282 votes). Check out past polls.

    Notices?