Created
March 19, 2012 02:19
-
-
Save mgng/2090885 to your computer and use it in GitHub Desktop.
Imagick::resizeImageの第3引数のFILTERって何指定すればいいの
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 | |
| $filter_list = array( | |
| Imagick::FILTER_UNDEFINED, | |
| Imagick::FILTER_POINT, | |
| Imagick::FILTER_BOX, | |
| Imagick::FILTER_TRIANGLE, | |
| Imagick::FILTER_HERMITE, | |
| Imagick::FILTER_HANNING, | |
| Imagick::FILTER_HAMMING, | |
| Imagick::FILTER_BLACKMAN, | |
| Imagick::FILTER_GAUSSIAN, | |
| Imagick::FILTER_QUADRATIC, | |
| Imagick::FILTER_CUBIC, | |
| Imagick::FILTER_CATROM, | |
| Imagick::FILTER_MITCHELL, | |
| Imagick::FILTER_LANCZOS, | |
| Imagick::FILTER_BESSEL, | |
| Imagick::FILTER_SINC, | |
| ); | |
| foreach($filter_list as $filter) { | |
| $image = new Imagick('sample.jpg'); | |
| $s = microtime(true); | |
| $image->resizeImage(351, 234, $filter, 1); | |
| echo $filter, ':', microtime(true) - $s, PHP_EOL; | |
| $image->destroy(); | |
| } |
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
| 0:0.66938495635986 | |
| 1:0.095770120620728 ← 速い(Imagick::FILTER_POINT) | |
| 2:0.17681312561035 | |
| 3:0.27580690383911 | |
| 4:0.27328705787659 | |
| 5:0.2731659412384 | |
| 6:0.27361488342285 | |
| 7:0.2767698764801 | |
| 8:0.5736780166626 | |
| 9:0.37286710739136 | |
| 10:0.46955990791321 | |
| 11:0.46963095664978 | |
| 12:0.47155499458313 | |
| 13:0.66822910308838 | |
| 14:0.71671891212463 | |
| 15:0.88946485519409 ← 遅い(Imagick::FILTER_SINC) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment