random walk through fields of musings

Wednesday, December 24, 2008

photos side-by-side aka montages

I seem to do this infrequently enough that I need to make myself a reminder, luckily I wrote a script that is pretty self-explanatory -- in this example it puts two photos side by side (similar method can be used to make 6 2"x2" passport photographs print on a single 4x6 print -- much cheaper than going to one of those passport places).


use strict;
local($|) = 1;

use Image::Magick;
my(@file) = @ARGV;



$rv = $image->Read(@file);
warn "$rv" if $rv;

my($montage) = $image->Montage(
mattecolor=>'#FFFFFF', #does not take?

$rv = $montage->Write('mp.jpg');
warn "$rv" if "$rv";

If you have ImageMagick installed but not the perl bindings, you can do this on the command line too.


Unknown said...

The first thing I got out of this post was that passport photos no longer have to be on some special heat-sensitive photo paper any more (last time I needed a passport photo was long ago).

Unknown said...

Or rather, heat-resistant photo paper.