Created
June 17, 2014 08:16
-
-
Save mgng/2b3ab5c478d75ed3e823 to your computer and use it in GitHub Desktop.
Imagemagick で 画像リサイズと画質落としつつ gif アニメーションを作る
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
Version: ImageMagick 6.8.1-0 2012-12-17 Q16 http://www.imagemagick.org | |
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC | |
Features: OpenMP | |
#1 : 1.4550831317902 | |
#2 : 0.72604203224182 | |
#3 : 0.45802593231201 |
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
<?php | |
// imagemagick バージョン情報出力 | |
exec( "convert --version", $version ); | |
echo implode( "\n", $version ), "\n"; | |
// 通常 | |
$s = microtime( true ); | |
exec( "convert -delay 25 -loop 0 ( 01.jpg 02.jpg 03.jpg 04.jpg ) out_1.gif" ); | |
$e = microtime( true ); | |
echo "#1 : ", ($e-$s), "\n"; | |
// 50%リサイズ | |
$s = microtime( true ); | |
exec( "convert -delay 25 -loop 0 ( 01.jpg 02.jpg 03.jpg 04.jpg ) ( -resize 50% ) out_2.gif" ); | |
$e = microtime( true ); | |
echo "#2 : ", ($e-$s), "\n"; | |
// 50%リサイズ&32色 | |
$s = microtime( true ); | |
exec( "convert -delay 25 -loop 0 ( 01.jpg 02.jpg 03.jpg 04.jpg ) ( -resize 50% -colors 32 ) out_3.gif" ); | |
$e = microtime( true ); | |
echo "#3 : ", ($e-$s), "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment