Created
July 17, 2011 15:19
-
-
Save hidekiy/1087677 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Imager; | |
use Imager::Fill; | |
use LWP::Simple; | |
my ($xsize, $ysize) = (60, 60); | |
my ($xnum, $ynum) = (5, 5); | |
my $img = Imager->new( | |
xsize => $xsize * $xnum, | |
ysize => $ysize * $ynum, | |
); | |
for my $x (0 .. $xnum) { | |
for my $y (0 .. $ynum) { | |
my $bgimg = Imager->new; | |
$bgimg->read(data => get('http://hidekiy.com/app/bgimg')); | |
$img->box( | |
xmin => $x * $xsize, | |
ymin => $y * $ysize, | |
xmax => $x * $xsize + $xsize - 1, | |
ymax => $y * $ysize + $ysize - 1, | |
fill => Imager::Fill->new(image => $bgimg), | |
); | |
} | |
} | |
$img->write(type => 'png', file => 'output.png'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment