http://www.imagemagick.org/script/perl-magick.php
documentに書いてある通りですが、次のとおりです
#!/usr/local/bin/perl use strict; use Image::Magick; use Data::Dumper; # refer to http://www.imagemagick.org/script/perl-magick.php main(@ARGV); sub main { my (@org_img_files) = @_; my $img_mgk = Image::Magick->new(); for my $org_img_file ( @org_img_files ){ $img_mgk->ReadImage($org_img_file); #サイズ変更 resize / trim $img_mgk->Crop(geometry=>'220x220+90+90'); #W x H +OffsetX +OffsetY #色変換 (fill:塗り潰し色, fuzz:微妙な色もいい感じに認識) # $img_mgk->Opaque(color=>'#ffffff', fill=>'#cccccc', fuzz=>'50%'); #透過 $img_mgk->Transparent(color=>'#000000'); } #複数fileをReadImage()している為、Write()だけでアニメーションGIFに ※ $img_mgk->Write('new.gif'); }
※ androidの環境によっては、Write()で作成した動画が再生できない為、image magickのコマンドラインツールでアニメーションgifを作成して下さい
$ /usr/local/bin/convert -delay 10 -loop 1 new_*.gif hira_a.gif