Created
August 8, 2012 00:41
-
-
Save syohex/3290966 to your computer and use it in GitHub Desktop.
Extract gif and convert these frame into png
This file contains hidden or 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
#!perl | |
use strict; | |
use warnings; | |
use Imager; | |
my $input = shift or die "Usage: $0 inputfile"; | |
my $imager = Imager->new; | |
my @imgs = $imager->read_multi(file => $input) or $imager->errstr; | |
my $i = 1; | |
for my $img (@imgs) { | |
my $output = sprintf "%d.png", $i++; | |
$img->write(file => $output, type => 'png') or die $img->errstr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment