#!/usr/bin/perl
#
# Name:
#	im-hax-montage-2.pl.
#
# Purpose:
#	Demonstrate the Montage method.
#
# V 1.00 17-Jan-2002
# ------------------
# o Initial version
#
# Test environment:
#	OS: WinNT 4 SP 6a
#	Web server: Apache V 1.3.26
#	IM: V 5.4.7

#
# Input files:
#	/HomePage/Pictures/gray.png
#	/HomePage/Pictures/green.png
#	/HomePage/Pictures/maroon.png
#	/HomePage/Pictures/olive.png
#
# Output files:
#	/apache/htdocs/im-hax-montage-2.png
#
# Note:
#	o tab = 4 spaces || die.
#	o Text reformatted to max 50 chars wide
#		so source can be converted to PDF
#
# Author:
#	Ron Savage <ron@savage.net.au>
#	http://savage.net.au/ImageMagick.html
#
# Licence:
#	Copyright (c) 1999-2002 Ron Savage
#
#	All Programs of mine are
#	'OSI Certified Open Source Software';
#	you can redistribute them and/or modify them
#	under the terms of the Artistic License,
#	a copy of which is available at:
#	http://www.opensource.org/licenses/index.html

use strict;
use warnings;

use Image::Magick;

# ----------------------------------------------

my($i) = Image::Magick -> new();

my($result);

$result = $i -> Read
(
	'/HomePage/Pictures/olive.png',
	'/HomePage/Pictures/green.png',
	'/HomePage/Pictures/gray.png',
	'/HomePage/Pictures/maroon.png'
);
warn $result if ($result);

my($j) = $i -> Montage
(
	background	=> 'white',
	frame		=> '3x3',
	tile		=> '2x2',
);
warn $result if ($result);

my($output_file_name)	=
	'png:/apache/htdocs/im-hax-montage-2.png';
$result					=
	$j -> Write($output_file_name);
warn $result if ($result);

print "Wrote $output_file_name\n";
