Gif is generated slowly
Posted: 2011-08-04T00:53:52-07:00
Hi,
My task is to generate gif animation from 3 images. Here they are:
http://www.picamatic.com/show/2011/08/0 ... 00x336.jpg
http://www.picamatic.com/show/2011/08/0 ... 00x336.jpg
http://www.picamatic.com/show/2011/08/0 ... 00x336.jpg
I use PerlMagick:
And everything is fine except the writing file on disk.
"Write" function takes more than 5 sec, while everything else takes less than 1 sec.
Could you please help me with the advice is there any way to speedup writing on disk?
Or may be there is something wrong in code?
Thanks in advance!
My task is to generate gif animation from 3 images. Here they are:
http://www.picamatic.com/show/2011/08/0 ... 00x336.jpg
http://www.picamatic.com/show/2011/08/0 ... 00x336.jpg
http://www.picamatic.com/show/2011/08/0 ... 00x336.jpg
I use PerlMagick:
Code: Select all
my $gif = Image::Magick->new();
$gif->Set( page => "500x336", magick => "gif" );
for( my $i = 1; $i <= 3; $i++ ) {
$gif->Read( "$i.jpg" );
}
for( my $i = 1; $i <= 3; $i++ ) {
$gif->[$i-1]->Set( "dispose" => "Previous", "delay" => 10 );
}
$gif->Write("animation.gif");
And everything is fine except the writing file on disk.
"Write" function takes more than 5 sec, while everything else takes less than 1 sec.
Could you please help me with the advice is there any way to speedup writing on disk?
Or may be there is something wrong in code?
Thanks in advance!