{"id":2446,"date":"2012-07-05T18:35:49","date_gmt":"2012-07-05T09:35:49","guid":{"rendered":"http:\/\/labs.gree.jp\/blog\/?p=2446"},"modified":"2021-04-27T15:03:42","modified_gmt":"2021-04-27T06:03:42","slug":"post2446","status":"publish","type":"post","link":"https:\/\/labs.gree.jp\/blog\/2012\/07\/2446\/","title":{"rendered":"ImageMagick \u6539\u9020\u5165\u9580 (\u305d\u306e\u58f1) GIF\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u958b\u767a\u30c1\u30fc\u30e0\u306e\u3088\u3084\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001ImageMagick \u306b\u3064\u3044\u3066\u304a\u8a71\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>  <a href=\"http:\/\/www.imagemagick.org\/\">http:\/\/www.imagemagick.org\/<\/a> <a href=\"http:\/\/labs.gree.jp\/blog\/2012\/07\/2446\/logo\/\" rel=\"attachment wp-att-4898\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/logo.jpg\" alt=\"\" title=\"logo\" width=\"123\" height=\"118\" class=\"aligncenter size-full wp-image-4898\" \/><\/a><\/li>\n<\/ul>\n<p>ImageMagick \u306f\u9ad8\u6a5f\u80fd\u3067\u5927\u5909\u4fbf\u5229\u306a\u753b\u50cf\u51e6\u7406\u30c4\u30fc\u30eb\u3067\u3059\u3002\u5f0a\u793e\u3067\u3082\u5229\u7528\u3055\u305b\u3066\u9802\u3044\u3066\u3044\u307e\u3059\u304c\u3001<strong>\u7a00\u306b\u5b9f\u30b5\u30fc\u30d3\u30b9\u306b\u305d\u306e\u307e\u307e\u9069\u7528\u51fa\u6765\u306a\u3044<\/strong>\u30b1\u30fc\u30b9\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u3053\u3067\u3001\u56f0\u3063\u305f\u6642\u306b ImageMagick \u81ea\u4f53\u3092\u6539\u9020\u3059\u308b\u969b\u306e\u30dd\u30a4\u30f3\u30c8\u3068\u3001\u5b9f\u969b\u306e\u5fdc\u7528\u4f8b\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h3 id=\"hs_5ca51953a8402c72743c5fec5a84e350_header_0\"> ImageMagick \u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u69cb\u9020<\/h3>\n<p>ImageMagick \u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u4e3b\u306b\u4ee5\u4e0b\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5206\u304b\u308c\u307e\u3059\u3002(Magick+ \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u7b49\u5e7e\u3064\u304b\u306f\u5272\u611b\u3057\u307e\u3059)<\/p>\n<ul>\n<li> utilities\/<\u30b3\u30de\u30f3\u30c9\u540d>.c \u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u306e\u8d77\u70b9(main \u95a2\u6570)<\/li>\n<li> wand\/\u301c.c (\u30b3\u30de\u30f3\u30c9\u5171\u901a\u51e6\u7406\u3068\u30b3\u30de\u30f3\u30c9\u6bce\u306e\u51e6\u7406\u3001Wand API)<\/li>\n<li> magick\/\u301c.c (\u6a5f\u80fd\u30e2\u30b8\u30e5\u30fc\u30eb\u3001\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3)<\/li>\n<li> coders\/\u301c.c (\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u51e6\u7406)<\/li>\n<\/ul>\n<p>\u4f8b\u3048\u3070\u3001convert \u30b3\u30de\u30f3\u30c9\u3067 PNG \u30d5\u30a1\u30a4\u30eb\u3092\u30ea\u30b5\u30a4\u30ba\u3057\u3066 GIF \u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\u5834\u5408\u306f\u3001\u5927\u307e\u304b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u7d4c\u8def\u3067\u52d5\u4f5c\u3057\u307e\u3059\u3002<\/p>\n<pre>\n% convert -resize 80x80 foo.png baa.gif<\/pre>\n<p><center><br \/>\n<a href=\"http:\/\/labs.gree.jp\/blog\/2012\/07\/2446\/convert\/\" rel=\"attachment wp-att-4880\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/convert.png\" alt=\"\" title=\"convert\" width=\"383\" height=\"260\" class=\"aligncenter size-full wp-image-4880\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/convert.png 383w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/convert-276x187.png 276w\" sizes=\"auto, (max-width: 383px) 100vw, 383px\" \/><\/a><br \/>\n<\/center><br \/>\n\u203b quantize.c \u306f\u6e1b\u8272\u51e6\u7406\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<p>\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u3084\u30e9\u30a4\u30d6\u30e9\u30ea API \u3092\u5909\u66f4\u3057\u305f\u3044\u5834\u5408\u306f\u5225\u3067\u3059\u304c\u3001<strong>\u8efd\u304f\u6a5f\u80fd\u3092\u6539\u9020\u3057\u3088\u3046\u3068\u3044\u3063\u305f\u5834\u5408\u306f magick\/ \u4ee5\u4e0b<\/strong>\u3092\u89e6\u308b\u4e8b\u304c\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u4eca\u56de\u3054\u7d39\u4ecb\u3059\u308b\u6539\u9020\u4f8b\u3082\u3001magick\/ \u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n<h3 id=\"hs_5ca51953a8402c72743c5fec5a84e350_header_1\"> ImageMagick \u3092 build \u3059\u308b<\/h3>\n<p>ImageMagick \u306e build \u306f Linux \u3084 MacOS \u4e0a\u3067\u306f\u7c21\u5358\u3067\u3059\u3002<br \/>\n\u203b zlib, libpng, jpeglib \u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u6700\u4f4e\u9650\u5fc5\u8981\u306a\u306e\u3067\u4e8b\u524d\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<pre>\n% tar xfz ImageMagick-6.7.0-7.tar.gz\n\n% cd ImageMagick-6.7.0-7\n% .\/configure --without-perl --prefix=\/home\/yoya\/test\/im670\n% make\n% make install<\/pre>\n<p>\u7b49\u306e\u3088\u3046\u306b prefix \u6307\u5b9a\u306e configure \u3092\u5b9f\u884c\u3057\u3066\u3001make install \u3059\u308b\u3068\u3001<\/p>\n<pre>\n% ls \/home\/yoya\/test\/im670\nbin  etc  include  lib  share\n% \/home\/yoya\/test\/im670\/bin\/identify php.gif \nphp.gif GIF 120x67 120x67+0+0 8-bit PseudoClass 128c 2.52KB 0.000u 0:00.000<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u305f\u5834\u6240\u306b\u5b9f\u884c\u95a2\u9023\u30d5\u30a1\u30a4\u30eb\u304c\u5c55\u958b\u3055\u308c\u3001\u3053\u3053\u306e bin \u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u306f\u5b9f\u884c\u304c\u53ef\u80fd\u3067\u3059\u3002\u5c1a\u3001--without-perl \u304c\u7121\u3044\u3068 make install \u3067 root \u6a29\u9650\u304c\u5fc5\u8981\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u3053\u3046\u3068\u3059\u308b\u306e\u3067\u6ce8\u610f\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<p>build \u3055\u3048\u51fa\u6765\u308c\u3070\u3001\u5f8c\u306f\u597d\u304d\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5f04\u3063\u3066\u6c17\u304c\u6e08\u3080\u307e\u3067 build \u3057\u76f4\u3057\u3066\u52d5\u4f5c\u3092\u78ba\u8a8d\u3057\u3066\u3044\u304f\u3060\u3051\u3067\u3059\u306d\uff01<\/p>\n<h3 id=\"hs_5ca51953a8402c72743c5fec5a84e350_header_2\"> GIF \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u5dee\u5206\u30d5\u30ec\u30fc\u30e0\u554f\u984c<\/h3>\n<h4 id=\"hs_5ca51953a8402c72743c5fec5a84e350_header_3\"> \u554f\u984c\u6982\u8981<\/h4>\n<p>\u3042\u308b\u65e5\u3001\u4ee5\u4e0b\u306eGIF\u753b\u50cf\u304c\u7279\u5b9a\u306e\u643a\u5e2f\u7aef\u672b\u3067\u8868\u793a\u3067\u304d\u306a\u3044\u3068\u306e\u554f\u3044\u5408\u308f\u305b\u3092\u9802\u304d\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"http:\/\/labs.gree.jp\/blog\/2012\/07\/2446\/ava\/\" rel=\"attachment wp-att-4832\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/ava.gif\" alt=\"\" title=\"ava\" width=\"240\" height=\"190\" class=\"aligncenter size-full wp-image-4832\" \/><\/a><\/p>\n<p>\u5b9f\u969b\u306b\u3001\u7279\u5b9a\u306e\u7aef\u672b\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u308b\u306e\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\u3002(\u643a\u5e2f\u7aef\u672b\u3067\u306e\u307f\u767a\u751f\u3059\u308b\u8868\u793a\u4e0d\u5177\u5408\u3092 PC \u4e0a\u3067\u518d\u73fe\u3059\u308b\u70ba\u306b GIF \u306e\u30d0\u30a4\u30ca\u30ea\u3092\u7de8\u96c6\u3057\u3066\u307e\u3059)<\/p>\n<p><a href=\"http:\/\/labs.gree.jp\/blog\/2012\/07\/2446\/ava-dispose2\/\" rel=\"attachment wp-att-4833\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/ava-dispose2.gif\" alt=\"\" title=\"ava-dispose2\" width=\"240\" height=\"190\" class=\"aligncenter size-full wp-image-4833\" style=\"background-color: black\"\/><\/a><\/p>\n<p>\u4e00\u898b\u3001\u4f55\u3067\u3082\u306a\u3044\u9759\u6b62 GIF \u753b\u50cf\u306b\u898b\u3048\u307e\u3059\u304c\u3001ImageMagick \u306e identify \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u3068\u3001GIF \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3067\u3042\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"superpre \">\n% identify ava.gif\nava.gif[0] GIF 240x190 240x190+0+0 PseudoClass 128c 8-bit 9.375kb \nava.gif[1] GIF 1x1 240x190+95+15 PseudoClass 2c 8-bit 9.375kb \nava.gif[2] GIF 1x1 240x190+95+15 PseudoClass 2c 8-bit 9.375kb \nava.gif[3] GIF 1x1 240x190+95+15 PseudoClass 2c 8-bit 9.375kb \nava.gif[4] GIF 1x1 240x190+95+15 PseudoClass 2c 8-bit 9.375kb \nava.gif[5] GIF 1x1 240x190+95+15 PseudoClass 2c 8-bit 9.375kb \nava.gif[6] GIF 1x1 240x190+95+15 PseudoClass 2c 8-bit 9.375kb \nava.gif[7] GIF 1x1 240x190+95+15 PseudoClass 2c 8-bit 9.375kb <\/pre>\n<p>\u3053\u306e <strong>1x1 240x190+95+15<\/strong> \u3068\u3044\u3046\u60c5\u5831\u306e\u524d\u63d0\u77e5\u8b58\u3068\u3057\u3066 GIF \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u6982\u8981\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h4 id=\"hs_5ca51953a8402c72743c5fec5a84e350_header_4\"> GIF \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3<\/h4>\n<ul>\n<li>\n GIF \u306e\u4ed5\u69d8\u306f\u4ee5\u4e0b\u306e URL \u306b\u3042\u308a\u307e\u3059\u3002\u4e21\u65b9\u4f75\u305b\u3066\u304a\u8aad\u307f\u4e0b\u3055\u3044\u3002<\/p>\n<ul>\n<li>  <a href=\"http:\/\/www.w3.org\/Graphics\/GIF\/spec-gif87.txt\">http:\/\/www.w3.org\/Graphics\/GIF\/spec-gif87.txt<\/a><\/li>\n<li>  <a href=\"http:\/\/www.w3.org\/Graphics\/GIF\/spec-gif89a.txt\">http:\/\/www.w3.org\/Graphics\/GIF\/spec-gif89a.txt<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li> GIF \u753b\u50cf\u306f Screen \u3068 Image \u306b\u5206\u3051\u3066\u8003\u3048\u307e\u3059\u3002<\/li>\n<\/ul>\n<p><center><br \/>\n<a href=\"http:\/\/labs.gree.jp\/blog\/2012\/07\/2446\/gif_screen1\/\" rel=\"attachment wp-att-5036\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/gif_screen1.png\" alt=\"\" title=\"gif_screen1\" width=\"310\" height=\"198\" class=\"aligncenter size-full wp-image-5036\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/gif_screen1.png 310w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/gif_screen1-276x176.png 276w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><\/a><br \/>\n<\/center><\/p>\n<ul>\n<li> \u307e\u305a\u3001\u8868\u793a\u9818\u57df\u3068\u3057\u3066 Screen \u306e\u5927\u304d\u3055 (width x height) \u3092\u6c7a\u3081\u307e\u3059\u3002<\/li>\n<li> \u305d\u306e\u4e0a\u3067\u3001Screen \u5185\u306e\u7279\u5b9a\u9818\u57df (Image \u306e left, top, width, height) \u3092\u6307\u5b9a\u3057\u3066\u753b\u50cf\u3092\u63cf\u753b\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<p><center><br \/>\n<a href=\"http:\/\/labs.gree.jp\/blog\/2012\/07\/2446\/gif_screen_image\/\" rel=\"attachment wp-att-4887\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/gif_screen_image.png\" alt=\"\" title=\"gif_screen_image\" width=\"446\" height=\"169\" class=\"aligncenter size-full wp-image-4887\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/gif_screen_image.png 446w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/gif_screen_image-276x104.png 276w\" sizes=\"auto, (max-width: 446px) 100vw, 446px\" \/><\/a><br \/>\n<\/center><\/p>\n<ul>\n<li> \u9759\u6b62\u753b\u306e GIF \u306f\u901a\u5e38\u3001\u540c\u3058\u30b5\u30a4\u30ba\u306e Screen \u3068 Image \u304c\uff11\u3064\u305a\u3064\u5b58\u5728\u3057\u307e\u3059\u3002<\/li>\n<li> \u6700\u9069\u5316\u3057\u306a\u3044 GIF \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u540c\u3058\u30b5\u30a4\u30ba\u306e Screen \u3068 Image(x\u30b3\u30de\u6570)\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u4e0a\u306e\u56f3\u306e\u5de6\u5074\u306e\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002(\u540c\u3058\u30b5\u30a4\u30ba\u306e Image \u3067\u4e0a\u66f8\u304d)<\/li>\n<li> \u6700\u9069\u5316\u3057\u305f GIF \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u4e0a\u306e\u56f3\u306e\u53f3\u5074\u306e\u3088\u3046\u306a\u30a4\u30e1\u30fc\u30b8\u306b\u306a\u308a\u307e\u3059\u3002(\u5dee\u5206\u306e\u3042\u308b\u90e8\u5206\u3060\u3051 Image \u3067\u4e0a\u66f8\u304d)<\/li>\n<\/ul>\n<h4 id=\"hs_5ca51953a8402c72743c5fec5a84e350_header_5\">  GIF \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u6700\u9069\u5316<\/h4>\n<p>ImageMagick \u306e convert \u30b3\u30de\u30f3\u30c9\u306b -layers optimize \u3092\u5f15\u6570\u3068\u3057\u3066\u4e0e\u3048\u308b\u3068\u3001GIF \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u751f\u6210\u3059\u308b\u6642\u306b\u6700\u9069\u5316\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre>\n% convert -layers optimize foo[1-3].png baa.gif<\/pre>\n<h5 id=\"hs_5ca51953a8402c72743c5fec5a84e350_header_6\"> \u5dee\u5206\u30af\u30ea\u30c3\u30d7<\/h5>\n<p>\u307e\u305a\u5dee\u5206\u306e\u3042\u308b\u90e8\u5206\u3092\u30af\u30ea\u30c3\u30d7\u3057\u3066\u3001\u305d\u3053\u3060\u3051\u753b\u50cf\u30c7\u30fc\u30bf\u3068\u3057\u3066\u6301\u3061\u307e\u3059\u3002<\/p>\n<p><center><br \/>\n<a href=\"http:\/\/labs.gree.jp\/blog\/2012\/07\/2446\/gifanime_crop\/\" rel=\"attachment wp-att-5006\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/gifanime_crop.png\" alt=\"\" title=\"gifanime_crop\" width=\"553\" height=\"324\" class=\"aligncenter size-full wp-image-5006\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/gifanime_crop.png 553w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/gifanime_crop-276x161.png 276w\" sizes=\"auto, (max-width: 553px) 100vw, 553px\" \/><\/a><br \/>\n<\/center><\/p>\n<p>\u5148\u7a0b identify \u3067\u51fa\u529b\u3055\u308c\u305f <strong>1x1 240x190+95+15<\/strong> \u306f Screen \u4e0a \u306e (95, 15) \u306e\u4f4d\u7f6e\u304b\u3089 1x1 \u30b5\u30a4\u30ba\u306e\u9818\u57df\u3092\u5dee\u5206\u30d5\u30ec\u30fc\u30e0\u3068\u3057\u3066\u6301\u3064\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<\/p>\n<h5 id=\"hs_5ca51953a8402c72743c5fec5a84e350_header_7\"> \u900f\u660e\u5316<\/h5>\n<p>\u6b21\u306b\u3001\u524d\u306e\u30b3\u30de\u3068<strong>\u5909\u5316\u306e\u306a\u3044 pixel \u304c\u3042\u308c\u3070\u900f\u660e\u8272<\/strong>\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><center><br \/>\n<a href=\"http:\/\/labs.gree.jp\/blog\/2012\/07\/2446\/gif_trans\/\" rel=\"attachment wp-att-4907\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/gif_trans.png\" alt=\"\" title=\"gif_trans\" width=\"216\" height=\"178\" class=\"aligncenter size-full wp-image-4907\" \/><\/a><br \/>\n<\/center><\/p>\n<p>GIF \u306f\u6700\u7d42\u7684\u306b\u753b\u50cf\u3092\u5727\u7e2e\u3057\u3066\u683c\u7d0d\u3059\u308b\u306e\u3067\u3001\u5358\u4e00\u8272(\u3053\u306e\u5834\u5408\u306f\u900f\u660e\u8272)\u306e\u5834\u6240\u304c\u591a\u3044\u7a0b\u3001GIF \u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u304c\u5c0f\u3055\u304f\u306a\u308a\u304a\u5f97\u3067\u3059\u3002<\/p>\n<h4 id=\"hs_5ca51953a8402c72743c5fec5a84e350_header_8\"> \u8868\u793a\u4e0d\u5177\u5408\u306e\u8abf\u67fb\u7d50\u679c<\/h4>\n<h5 id=\"hs_5ca51953a8402c72743c5fec5a84e350_header_9\">  \u539f\u56e0<\/h5>\n<ul>\n<li>\n \u7279\u5b9a\u306e\u643a\u5e2f\u7aef\u672b\u306b\u304a\u3044\u3066\u3001<\/p>\n<ul>\n<li> GIF \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u5dee\u5206\u30d5\u30ec\u30fc\u30e0\u306e\u5927\u304d\u3055\u304c 2x2 \u672a\u6e80 (1x1, 1x2, 2x1 \u306e3\u30d1\u30bf\u30fc\u30f3) \u306e\u6642\u306b\u3001\u6b63\u3057\u304f GIF \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u8868\u793a\u51fa\u6765\u306a\u3044\u3002<\/li>\n<li> \u5177\u4f53\u7684\u306b\u306f (dispose=1 \u306a\u306e\u306b) dispose=2 \u76f8\u5f53\u306e\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3092\u884c\u3046\u4e0d\u5177\u5408\u304c\u5b58\u5728\u3059\u308b\u3068\u601d\u308f\u308c\u308b\u3002(dispose \u306f\u30b3\u30de\u304c\u9032\u3080\u6642\u306b\u753b\u50cf\u3092\u3069\u3046\u4e0a\u66f8\u304d\u3059\u308b\u304b\u3092\u793a\u3059\u756a\u53f7\u3002\u8a73\u3057\u304f\u306f<a href =\"http:\/\/www.w3.org\/Graphics\/GIF\/spec-gif89a.txt\">spec-gif89a.txt<\/a> \u3092\u53c2\u7167)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5 id=\"hs_5ca51953a8402c72743c5fec5a84e350_header_10\">  \u5bfe\u5fdc<\/h5>\n<ul>\n<li> GIF \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u5dee\u5206\u30d5\u30ec\u30fc\u30e0\u306e\u5927\u304d\u3055\u304c 2x2 \u672a\u6e80\u306e\u6642\u306b\u30012x2 \u4ee5\u4e0a\u306b\u306a\u308b\u3088\u3046\u62e1\u3052\u308b\u3002<\/li>\n<\/ul>\n<h4 id=\"hs_5ca51953a8402c72743c5fec5a84e350_header_11\"> \u5dee\u5206\u30d5\u30ec\u30fc\u30e0\u67a0\u51e6\u7406\u306e\u6539\u9020<\/h4>\n<p>\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u51e6\u7406\u306f wand\/mogriry.c \u306b\u307e\u3068\u307e\u3063\u3066\u3044\u3066\u3001optimize \u306e\u6587\u5b57\u5217\u3067\u63a2\u3059\u3068 -layers optimize \u3092\u51e6\u7406\u3059\u308b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u304c\u898b\u3064\u304b\u308a\u307e\u3059\u3002<br \/>\n<strong>wand\/mogrify.c - MagickCommandGenesis<\/strong><\/p>\n<pre class=\"superpre \">\n              case OptimizeLayer:\n              {\n                \/*                                                              \n                  General Purpose, GIF Animation Optimizer.                     \n                *\/\n                \/\/ \u6700\u9069\u5316\u3092\u89e3\u3044\u3066\u30d9\u30bf\u306a\u7d19\u829d\u5c45\u306e\u30b3\u30de\u306b\u3059\u308b\n                layers=CoalesceImages(*images,exception);\n  \uff1c\u7565\uff1e\n                \/\/ \u524d\u30d5\u30ec\u30fc\u30e0\u3068\u5dee\u5206\u306e\u3042\u308b\u90e8\u5206\u3092\u30af\u30ea\u30c3\u30d7\u3057\u305f\u30b3\u30de\u306b\u5dee\u3057\u66ff\u3048\u308b\n                layers=OptimizeImageLayers(*images,exception);\n  \uff1c\u7565\uff1e\n                \/\/ \u524d\u30d5\u30ec\u30fc\u30e0\u3068\u5909\u5316\u306e\u306a\u3044pixel\u3092\u900f\u660e\u306b\u3059\u308b\n                OptimizeImageTransparency(*images,exception);\n  \uff1c\u7565\uff1e\n                \/\/ \u900f\u660e\u8272\u3092\u542b\u3081\u3066256\u8272\u4ee5\u4e0b\u306b\u6e1b\u8272\n                (void) RemapImages(quantize_info,*images,(Image *) NULL);\n                break;<\/pre>\n<p>OptimizeImageLayers \u304b\u3089 OptimizeLayerFrames \u3068\u8fbf\u3063\u305f\u5148\u306b\u3001\u5dee\u5206\u30d5\u30ec\u30fc\u30e0\u3092\u30af\u30ea\u30c3\u30d7\u3059\u308b\u51e6\u7406\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><strong>magick\/layer.c - OptimizeLayerFrames<\/strong><\/p>\n<pre class=\"superpre \">\nbounds[i]=CompareImageBounds(curr->previous,curr,CompareAnyLayer,exception)\nif ( bounds[i].x < 0 ) {\n       ( \u5dee\u5206\u304c\u306a\u3044\u6642\u306e\u51e6\u7406 )\n  } \n  else\n     {\n        \/*\n          Compare a none disposal against a previous disposal\n        *\/\n\n       ( \u5dee\u5206\u304c\u3042\u308b\u6642\u306e\u51e6\u7406 )<\/pre>\n<p>\u3067\u3059\u306e\u3067\u3001bounds \u306e width, height \u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u62e1\u5f35\u3059\u308c\u3070\u826f\u3044\u306f\u305a\u3002<\/p>\n<pre class=\"superpre \">\n    else\n      {\n        \/*                                                              \n          Compare a none disposal against a previous disposal           \n        *\/\n\n       \/* for AU mobile terminal *\/\n        if ((bounds[i].width == 1) && (1 < image->columns)) {\n           bounds[i].width = 2;\n           if (image->columns < bounds[i].x + 2) { \/\/ \u53f3\u306b\u306f\u307f\u51fa\u308b\u5834\u5408\n          bounds[i].x --; \/\/ \u5de6\u306b\u30b7\u30d5\u30c8\n           }\n       }\n       if ((bounds[i].height == 1) && (1 < image->rows)) {\n           bounds[i].height = 2;\n           if (image->rows < bounds[i].y + 2) { \/\/ \u4e0b\u306b\u306f\u307f\u51fa\u308b\u5834\u5408\n               bounds[i].y --; \/\/ \u4e0a\u306b\u30b7\u30d5\u30c8\n           }\n       }<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b width, height \u304c 1 \u306e\u6642\u306b 2 \u306b\u62e1\u5f35\u3059\u308b\u51e6\u7406\u3092\u5165\u308c\u307e\u3059\u3002<br \/>\n\u4e00\u756a\u53f3\u3084\u4e0b\u306e pixel \u3092\u53f3\u4e0b\u306b\u62e1\u5f35\u3059\u308b\u3068 Screen \u304b\u3089\u306f\u307f\u51fa\u3066\u3057\u307e\u3046\u4e8b\u3078\u306e\u914d\u616e\u3067\u3001\u5de6\u4e0a\u306b\u30b7\u30d5\u30c8\u3059\u308b\u51e6\u7406\u3082\u5165\u308c\u307e\u3059\u3002<br \/>\n<center><br \/>\n<a href=\"http:\/\/labs.gree.jp\/blog\/2012\/07\/2446\/gif2x2\/\" rel=\"attachment wp-att-5007\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/gif2x2.png\" alt=\"\" title=\"gif2x2\" width=\"361\" height=\"324\" class=\"aligncenter size-full wp-image-5007\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/gif2x2.png 361w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2012\/06\/gif2x2-222x200.png 222w\" sizes=\"auto, (max-width: 361px) 100vw, 361px\" \/><\/a><br \/>\n<\/center><\/p>\n<ul>\n<li> \u7d50\u679c<\/li>\n<\/ul>\n<pre class=\"superpre \">\n% \/home\/yoya\/test\/im\/bin\/convert -layers optimize [1-8].png ava.gif\n% \/home\/yoya\/test\/im\/bin\/identify ava.gif\nava.gif[0] GIF 240x190 240x190+0+0 PseudoClass 256c 8-bit 10.4922kb \nava.gif[1] GIF 2x2 240x190+95+15 PseudoClass 256c 8-bit 10.4922kb \nava.gif[2] GIF 2x2 240x190+95+15 PseudoClass 256c 8-bit 10.4922kb \nava.gif[3] GIF 2x2 240x190+95+15 PseudoClass 256c 8-bit 10.4922kb \nava.gif[4] GIF 2x2 240x190+95+15 PseudoClass 256c 8-bit 10.4922kb \nava.gif[5] GIF 2x2 240x190+95+15 PseudoClass 256c 8-bit 10.4922kb \nava.gif[6] GIF 2x2 240x190+95+15 PseudoClass 256c 8-bit 10.4922kb \nava.gif[7] GIF 2x2 240x190+95+15 PseudoClass 256c 8-bit 10.4922kb <\/pre>\n<p>\u3053\u308c\u3067\u3001\u5dee\u5206\u30d5\u30ec\u30fc\u30e0\u306e\u5927\u304d\u3055\u304c 2x2 \u4ee5\u4e0a\u3067\u3042\u308b\u4e8b\u304c\u4fdd\u969c\u3055\u308c\u308b\u70ba\u30011x1 \u3067\u8868\u793a\u304c\u58ca\u308c\u308b\u7aef\u672b\u3067\u3082\u554f\u984c\u306a\u304f\u8868\u793a\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3 id=\"hs_5ca51953a8402c72743c5fec5a84e350_header_12\"> \u305d\u3082\u305d\u3082\u8ad6<\/h3>\n<p>\u4eca\u56de\u4f8b\u306b\u6319\u3052\u305f\u30a2\u30d0\u30bf\u30fc\u753b\u50cf\u306e\u5834\u5408\u306f\u3001\u30b3\u30de\u9593\u306e\u5dee\u5206\u62bd\u51fa\u30ed\u30b8\u30c3\u30af\u3092\u5f04\u3063\u3066 1 pixel \u306e\u5dee\u5206\u306f\u7121\u304b\u3063\u305f\u4e8b\u306b\u3057\u305f\u65b9\u304c\u826f\u3044\u3067\u3059\u3002<br \/>\n\u305f\u3060\u3001\u305d\u306e 1 pixel \u304c\u30e6\u30fc\u30b6\u306b\u3068\u3063\u3066\u5927\u5207\u306a\u8272\u3067\u3042\u308b\u53ef\u80fd\u6027\u3082\u8003\u3048\u3089\u308c\u308b\u306e\u3067\u30011 pixel \u306e\u5dee\u5206\u3082\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u51fa\u6765\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3002\u3068\u3044\u3046\u60f3\u3044\u3067\u3053\u306e\u6539\u9020\u3092\u30b5\u30fc\u30d3\u30b9\u306b\u9069\u7528\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3 id=\"hs_5ca51953a8402c72743c5fec5a84e350_header_13\"> \u6b21\u56de\u4e88\u544a<\/h3>\n<p>\u3053\u308c\u3068\u306f\u5225\u306b\u3001GIF \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u751f\u6210\u6642\u9593\u3092\u77ed\u304b\u304f\u3059\u308b\u70ba\u3001\u6e1b\u8272\u51e6\u7406\u306e\u9ad8\u901f\u5316\u3082\u884c\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u6b21\u56de\u306f\u3001\u305d\u3061\u3089\u306e\u4f8b\u3092\u3054\u7d39\u4ecb\u3059\u308b\u4e88\u5b9a\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u958b\u767a\u30c1\u30fc\u30e0\u306e\u3088\u3084\u3067\u3059\u3002 \u4eca\u56de\u306f\u3001ImageMagick \u306b\u3064\u3044\u3066\u304a\u8a71\u3057\u307e\u3059\u3002 http:\/\/www.imagemagick.org\/ ImageMagick \u306f\u9ad8\u6a5f\u80fd\u3067\u5927\u5909\u4fbf\u5229\u306a\u753b\u50cf\u51e6\u7406\u30c4\u30fc\u30eb\u3067\u3059 [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[24,23],"class_list":["post-2446","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-info","tag-gif","tag-image"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/2446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/comments?post=2446"}],"version-history":[{"count":3,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/2446\/revisions"}],"predecessor-version":[{"id":21161,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/2446\/revisions\/21161"}],"wp:attachment":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/media?parent=2446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/categories?post=2446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/tags?post=2446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}