Skip to content

Instantly share code, notes, and snippets.

@junichiro
Created December 15, 2009 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save junichiro/256987 to your computer and use it in GitHub Desktop.
Save junichiro/256987 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use Image::Imlib2;
use Data::Dumper;
my ( $width, $height ) = ( 150, 320 );
my $image_dir = 'images/avater';
my @image_files = glob("$image_dir/*");
my @images;
foreach (@image_files) {
push( @images, Image::Imlib2->load($_) );
}
my $background = shift @images;
foreach (@images) {
$background->blend( $_, 1, 0, 0, $width, $height, 0, 0, $width, $height );
}
$background->save("$image_dir/out.png");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment