#!/usr/bin/perl use warnings; use strict; use Image::Magick; my $image = Image::Magick->new; umask 0022; my @pics= <*.png>; foreach my $pic (@pics){ my ($picbasename) = $pic =~ /^(.*).png$/; my $ok; $ok = $image->Read($pic) and warn ($ok); my $thumb = $picbasename . '-t.png'; $image->Scale(geometry => '100x100'); $ok = $image->Write($thumb) and warn ($ok); undef @$image; #needed if $image is created outside loop print "$pic -> $thumb\n"; } #### #!/usr/bin/perl use warnings; use strict; use Image::Magick; my $image = Image::Magick->new; umask 0022; my @pics= <*.png>; my $ok; foreach (@pics){ $ok = $image->Read($_) and warn ($ok); } $image->Scale(geometry => '100x100'); $ok = $image->Write('thumb.png') and warn ($ok); #### #!/usr/bin/perl use warnings; use strict; use Image::Magick; my $image = Image::Magick->new; umask 0022; my @pics= <*.png>; my $ok; foreach (@pics){ $ok = $image->Read($_) and warn ($ok); } my $montage = $image->Montage(geometry=>'128x160+8+4>',gravity=>'Center', tile=>'6x+10+200',compose=>'over',background=>'#ffffff', font=>'Generic.ttf',pointsize=>18,fill=>'#600',stroke=>'none'); $ok = $montage->Write('montage.png') and warn ($ok);