{"id":2632,"date":"2020-05-18T16:27:08","date_gmt":"2020-05-18T07:27:08","guid":{"rendered":"https:\/\/its-more.jp\/ja_jp\/?p=2632"},"modified":"2020-05-19T04:05:10","modified_gmt":"2020-05-18T19:05:10","slug":"png%e3%81%ae%e7%94%9f%e6%88%90","status":"publish","type":"post","link":"https:\/\/its-more.jp\/ja_jp\/?p=2632","title":{"rendered":"go\u306b\u3088\u308bpng\u306e\u751f\u6210"},"content":{"rendered":"\n<p>\u30b5\u30fc\u30d0\u3067\u753b\u50cf\u3092\u751f\u6210\u3057\u3066\u914d\u4fe1\u3057\u305f\u3044\u3002\u307e\u305a\u306f\u9759\u6b62\u753b\u3067\u3001\u30a2\u30a4\u30b3\u30f3\u3001\u30b0\u30e9\u30d5\u3001QR\u30b3\u30fc\u30c9\u7b49\u3002\u9ad8\u3005100KB\u7a0b\u5ea6\u306e\u753b\u50cf\u3092\u60f3\u5b9a\u3057\u3066\u3044\u308b\u3002\u8981\u3059\u308b\u306b\u3001\u3069\u306e\u30d4\u30af\u30bb\u30eb\u3092\u4f55\u8272\u306b\u3059\u308b\u304b\u3001\u3060\u3051\u306e\u30c7\u30fc\u30bf\u306a\u306e\u3060\u304b\u3089\u3001\u7c21\u5358\u306b\u3067\u304d\u308b\u306b\u9055\u3044\u306a\u3044\u3002<\/p>\n\n\n\n<h2>PNG\u9078\u5b9a\u307e\u3067\u306e\u7d4c\u7def<\/h2>\n\n\n\n<p>\u9759\u6b62\u753b\u306a\u3089png\u304c\u5f62\u5f0f\u304c\u30b7\u30f3\u30d7\u30eb\u3067\u826f\u304b\u3063\u305f\u8a18\u61b6\u304c\u3042\u308b\u3002\u6a5f\u80fd\u7684\u306b\u5927\u304d\u306a\u554f\u984c\u304c\u306a\u3051\u308c\u3070PNG\u3067\u884c\u304d\u305f\u3044\u6c17\u5206\u3002<\/p>\n\n\n\n<p>\u9759\u6b62\u753b\u3001\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u3050\u3050\u308b\u3068\u3001<a href=\"https:\/\/sole-color-blog.com\/blog\/103\/\">\u3053\u306e\u30d6\u30ed\u30b0<\/a>\u304c\u5148\u982d\u306b\u304f\u308b\u3002\u6bd4\u8f03\u5bfe\u8c61\u3068\u3057\u3066\u3042\u3052\u3089\u308c\u3066\u3044\u308b JPEG, GIF, PNG, TIFF, BMP\u3002\u751f\u6210\u3059\u308b\u753b\u50cf\u306f\u5199\u771f\u3067\u306f\u7121\u3044\u306e\u3067\u3001JPEG\u306f\u5fc5\u8981\u7121\u3044\u3002\u305f\u3060\u306e\u4e00\u679a\u306e\u9759\u6b62\u753b\u306a\u306e\u3067TIFF\u3067\u3042\u308b\u5fc5\u8981\u306f\u7121\u3044\u3002\u30d6\u30e9\u30a6\u30b6\u3067\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u76ee\u7684\u306a\u306e\u3067\u3001\u3084\u306f\u308aPNG\u304b\u306a\u3002\u57fa\u672c\u7684\u306b\u306f\u3001\u975e\u5e38\u306b\u8fd1\u8ddd\u96e2\u3067\u3001\u5c0f\u3055\u3081\u306e\u753b\u50cf\u3092\u3084\u308a\u3068\u308a\u3059\u308b\u306e\u304c\u76ee\u7684\u306a\u306e\u3067\u3001\u5727\u7e2e\u306e\u6a5f\u80fd\u3082\u5fc5\u8981\u306a\u3044\u3068\u3044\u3046\u304bOFF\u306b\u3067\u304d\u308b\u3068\u826f\u3044\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/ja.wikipedia.org\/wiki\/\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u6bd4\u8f03\">Wiki<\/a> \u3092\u307f\u3066\u3082\u3001PNG\u304c\u9069\u5f53\u3068\u601d\u3046\u3002PNG\u304c\u51fa\u3066\u304d\u305f\u7d4c\u7def\u304b\u3089\u3057\u3066\u3001\u305d\u308c\u304c\u666e\u53ca\u3057\u305f\u73fe\u5728\u3001GIF\u306b\u623b\u308b\u5fc5\u8981\u306f\u306a\u3044\u306e\u3067\u306f\u3002\u3072\u3068\u3064\u3060\u3051\u6c17\u306b\u306a\u308b\u306e\u306fGIF\u30a2\u30cb\u30e1\u3002\u3067\u3082\u3001\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3PNG\u3068\u3044\u3046\u306e\u304c\u3042\u308b\u305d\u3046\u3067\u3001\u3053\u308c\u3082\u8a66\u3057\u3066\u307f\u305f\u3089\u3001\u73fe\u5728\u306e\u4e3b\u89815\u30d6\u30e9\u30a6\u30b6\u3067\u5168\u3066\u3067\u8868\u793a\u3067\u304d\u305f\u3002<\/p>\n\n\n\n<p>\u5168\u3066\u554f\u984c\u306a\u3057\u3002PNG\u304c\u826f\u3044\u3068\u601d\u3046\u3002<a href=\"https:\/\/ja.wikipedia.org\/wiki\/Portable_Network_Graphics\">Wiki \u306e PNG \u306e\u9805<\/a>\u3092\u898b\u305f\u3089\u3001\u3060\u3044\u305f\u3044\u305d\u3046\u8a00\u3046\u30e1\u30ea\u30c3\u30c8\u304c\u307e\u3068\u3081\u3089\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<h2>\u5b9f\u88c5\u8a00\u8a9e\u3068\u3057\u3066\u306eGo<\/h2>\n\n\n\n<p>\u305d\u308c\u3067\u4ed5\u69d8\u66f8\u306f\u4f55\u3060\u3063\u305f\u308d\u3046\u3068\u305f\u3050\u308b\u3068\u3001\u5927\u5143\u306f RFC 2083 \u3060\u3063\u305f\u3002<\/p>\n\n\n\n<p>Go\u3067\u3055\u304f\u3063\u3068\u5b9f\u88c5\u3057\u305f\u3044\u3002\u4ed5\u69d8\u3092\u3056\u3063\u3068\u898b\u3066\u3001\u5171\u901a\u30e9\u30a4\u30d6\u30e9\u30ea\u7684\u306a\u3082\u306e\u3067\u3001\u81ea\u4f5c\u306e\u7dda\u306f\u306a\u3044\u306a\u3068\u601d\u3046\u306e\u306f zlib\u3002\u3067\u3082\u3053\u308c\u306f go \u306b\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u3042\u308b\u3088\u3046\u306a\u306e\u3067OK\u3002CRC32\u3082\u554f\u984c\u306a\u3044\u3002\u305d\u3082\u305d\u3082\u53ef\u9006\u5727\u7e2e\u306a\u3093\u3060\u3057\u3001\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3068\u5727\u7e2e\u306f\u76f4\u4ea4\u3057\u3066\u3044\u308b\u306f\u305a\u3060\u3002<\/p>\n\n\n\n<p>\u3093\u3001\u307e\u3066\u3088\u3001\u305d\u3082\u305d\u3082Go \u306b\u306f PNG\u81ea\u4f53\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u3042\u308b\u306e\u3067\u306f\u306a\u3044\u304b\uff1f\u3084\u306f\u308a\u3001<a href=\"https:\/\/golang.org\/pkg\/image\/png\/\">Package png<\/a> \u3068\u3044\u3046\u306e\u304c\u3042\u3063\u305f\u3002\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306b\u3064\u3044\u3066\u306f\u3001\u3053\u308c\u306b\u4efb\u305b\u308c\u3070\u826f\u3044\u3089\u3057\u3044\u3002\u305d\u306e\u4e2d\u3067\u53c2\u7167\u3055\u308c\u3066\u3044\u308bPNG\u306e\u4ed5\u69d8\u306f\u3001<a href=\"https:\/\/www.w3.org\/TR\/PNG\/\">W3C<\/a>\u306e\u3082\u306e\u3060\u3063\u305f[https:\/\/www.w3.org\/TR\/PNG\/]\u30022003\u5e74\u7248\u3068\u3042\u308b\u306e\u3067\u3001\u3044\u3044\u611f\u3058\u306b\u67af\u308c\u3066\u308b\u306e\u3058\u3083\u3042\u308b\u307e\u3044\u304b\u3002<\/p>\n\n\n\n<h2>PNG\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8<\/h2>\n\n\n\n<p>Go \u3067 PNG \u3067\u884c\u3053\u3046\u3002\u5b9f\u969b\u3001\u3082\u3068\u3082\u3068\u305d\u306e\u4e00\u629e\u3060\u3063\u305f\u3068\u601d\u3046\u3002\u6e96\u62e0\u3059\u308b\u4ed5\u69d8\u306f W3C \u306e 2003 \u5e74\u7248\u3059\u306a\u308f\u3061\u3001ISO\/IEC 15948:2003 \u3068\u3059\u308b\u3002<\/p>\n\n\n\n<p class=\"has-background has-small-font-size has-very-light-gray-background-color\">Portable Network Graphics (PNG) Specification (Second Edition)<br><br>Information technology \u2014 Computer graphics and image processing \u2014 Portable Network Graphics (PNG): Functional specification. ISO\/IEC 15948:2003 (E)<br><br>W3C Recommendation 10 November 2003<br><br><a href=\"https:\/\/www.w3.org\/TR\/PNG\/\">https:\/\/www.w3.org\/TR\/PNG\/<\/a><\/p>\n\n\n\n<p>\u4ed5\u69d8\u66f8\u3092\u3056\u3063\u3068\u773a\u3081\u308b\u3002PDF\u306b\u3057\u3066\u307f\u3066\u308240\u301c50\u30da\u30fc\u30b8\u7a0b\u5ea6\u3060\u304b\u3089\u3001\u30b3\u30f3\u30d1\u30af\u30c8\u306a\u898f\u683c\u3060\u3002\u753b\u50cf\u304c\u5165\u3063\u3066\u3044\u308b\u306e\u304c IETF RFC\u3068\u306f\u9055\u3046\u3068\u3053\u308d\u3060\u306a\uff08\u7b11\uff09\u3002\u76ee\u6b21\u3084 Term &amp; definitions \u306e\u7ae0\u304c\u3057\u3063\u304b\u308a\u3057\u3066\u3044\u308b\u306e\u306f ISO \u306e\u8840\u306e\u5302\u3044\u304c\u3059\u308b\u3002\u3044\u308d\u3044\u308d\u66f8\u3044\u3066\u3042\u308b\u3051\u3069\u3001\u3068\u308a\u3042\u3048\u305a\u5fc5\u8981\u306a\u60c5\u5831\u3063\u3066\u6570\u30da\u30fc\u30b8\u7a0b\u5ea6\u3067\u306f\u3042\u308b\u307e\u3044\u304b\uff1f<\/p>\n\n\n\n<p>\u3084\u308a\u305f\u3044\u3053\u3053\u3068\u306f PNG \u5f62\u5f0f\u3092\u4f5c\u308b\u4e8b\u3001\u3064\u307e\u308a 4.7 PNG datastream \u3092\u4f5c\u308b\u4e8b\u3060\u3002\u30d8\u30c3\u30c0\u306e\u5f8c\u306f\u3001\u30c1\u30e3\u30f3\u30af\u306e\u9023\u7d9a\u3060\u3068\u66f8\u3044\u3066\u3042\u308b\u3002\u5fc5\u9808\uff08\u30af\u30ea\u30c6\u30a3\u30ab\u30eb\uff09\u306e\u30c1\u30e3\u30f3\u30af\u306f\u3001\u30d8\u30c3\u30c0\u3001\u30d1\u30ec\u30c3\u30c8\u3001\u30c7\u30fc\u30bf\u3001\u7d42\u7aef\u306e4\u7a2e\u985e\u304b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"596\" height=\"364\" src=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-17.57.06.png\" alt=\"\" class=\"wp-image-2641\" srcset=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-17.57.06.png 596w, https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-17.57.06-300x183.png 300w\" sizes=\"(max-width: 596px) 100vw, 596px\" \/><\/figure>\n\n\n\n<p>\u305d\u308c\u305e\u308c\u306e\u5b9a\u7fa9\u306f 11.2.2,3,4,5 \u306b\u3042\u308b\u30022\u30da\u30fc\u30b8\u7a0b\u5ea6\u306e\u4ed5\u69d8\u3060\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"596\" height=\"478\" src=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-17.58.36.png\" alt=\"\" class=\"wp-image-2643\" srcset=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-17.58.36.png 596w, https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-17.58.36-300x241.png 300w\" sizes=\"(max-width: 596px) 100vw, 596px\" \/><\/figure>\n\n\n\n<p>\u3060\u304c\u3001\u5024\u3092\u5341\u9032\u3067\u8868\u8a18\u3059\u308b\u306e\u3084\u3081\u3066\u6b32\u3057\u3044\u3002ISO\u6d41\u306a\u306e\u304b\uff1f\u306a\u305c\u300c73 72 68 82 \u3068\u3044\u3046\u30aa\u30af\u30c6\u30c3\u30c8\u5217\u306fASCII\u30b3\u30fc\u30c9\u3068\u3057\u3066\u89e3\u91c8\u3059\u308b\u3068\u5076\u7136\u3067\u306f\u306a\u304f\"IHDR\"\u3068\u3044\u3046\u6587\u5b57\u5217\u306b\u306a\u308a\u307e\u3059\u300d\u3068\u4e00\u8a00\u3001\u8a00\u3048\u306a\u3044\u306e\u3060\u308d\u3046\uff1f<br>\u307e\u3042\u3044\u3044\u3002\u611f\u3058\u306f\u308f\u304b\u3063\u305f\u3002\u3044\u3044\u611f\u3058\u3060\u3002\u3055\u304f\u3063\u3068\u884c\u3051\u305d\u3046\u306a\u6c17\u304c\u3059\u308b\u3002<\/p>\n\n\n\n<h2>\u30c8\u30e9\u30a4\u30a2\u30eb\u5b9f\u88c5\uff081\uff09<\/h2>\n\n\n\n<p>\u3055\u3063\u305d\u304f\u4f55\u304b\u4f5c\u3063\u3066\u307f\u3088\u3046\u3002\u3046\u30fc\u3093\u3001C\u3060\u3068\u7c21\u5358\u306b\u66f8\u3051\u308b\u306e\u3060\u304c\u3000\u2026\u3000\u3068\u308a\u3042\u3048\u305aC\u3067\u66f8\u3053\u3046\u304b\u3000\u2026\u3000\u3064\u304f\u308a\u521d\u3081\u3066\u307f\u305f\u304c\u4f55\u304b\u5909\u3060\u3002\u7121\u610f\u8b58\u306b mkgif.c \u3068\u3044\u3046\u540d\u524d\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u3044\u305f\uff08\u7b11\uff09<\/p>\n\n\n\n<p>\u3084\u306f\u308aGo\u3067\u66f8\u3053\u3046\u3002\u2026\u3000\u2026\u3000\u2026\u3000\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u3063\u305f\u3002<\/p>\n\n\n\n<p>\n<details>\n<summary>Pnggen\/0.0.1 \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/summary>\n<pre>\n\/\/\n\/\/ 2020-0518-01 pnggen\/0.0.1 (PNG generator) by ITS more :-)\n\/\/ Reference: https:\/\/www.w3.org\/TR\/PNG\/\n\/\/\npackage main\nimport (\n        \"os\"\n        \"fmt\"\n)\nfunc hton32b(s string, i int)(string){\n        s += string(0xFF & (i >> 24))\n        s += string(0xFF & (i >> 16))\n        s += string(0xFF & (i >> 8))\n        s += string(0xFF & (i))\n        return s\n}\nfunc putNetInt32(file *os.File, length int){\n        lengb := make([]byte, 4)\n        lengs := string(lengb)\n        lengs = \"\"\n        lengs = hton32b(lengs,length)\n        file.Write([]byte(lengs))\n}\nfunc main() {\n        outfile := \"x.png\"\n        fmt.Fprintf(os.Stderr,\"-- pnggen\/0.0.1 --\\n\") \n        file, _ := os.Create(outfile)\n        defer file.Close()\n        \n        PNGsignature := \"\\x89PNG\\r\\n\\x1A\\n\" \/\/ 5.2 PNG signature\n        file.Write([]byte(PNGsignature))\n        \n        \/\/ 5.3 Chunk fields := Length, Chunk Type, Chunk Data, CRC\n        ckdbuf := make([]byte, 256) \/\/ 5.3 CHUNK DATA buffer\n        chunkdtop := string(ckdbuf)\n        chunkdtop = \"\"\n        \n        \/\/ 11.2.2 IHDR Image header\n        IHDRtype := \"IHDR\" \/\/ IHDR chunk type\n        \/\/ IHDR chunk data\n        chunkd := hton32b(chunkdtop,64) \/\/ Width\n        chunkd = hton32b(chunkd,64) \/\/ Hight \n        chunkd += string(1) \/\/ Bit depth, 1 for monocrome\n        chunkd += string(0) \/\/ Color type, 0 for Grayscalse\n        chunkd += string(0) \/\/ Compression method, 0 for deflate\/inflate \n        chunkd += string(0) \/\/ Filter method, 0 for adaptive\n        chunkd += string(0) \/\/ Interlace method, 0 for no interlace\n        \/\/ IHDR CRC\n        \/\/ to be done\n        \n        putNetInt32(file,len(chunkd)) \/\/ Length\n        file.Write([]byte(IHDRtype))\n        file.Write([]byte(chunkd))\n\n        fmt.Fprintf(os.Stderr,\"-- created %s (%d x %d)\\n\",outfile,64,64) \n}\n<\/pre>\n<\/details>\n<p>\n\n\n\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u304b\u3089\u51fa\u529b\u3057\u305fPNG\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u8eab\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>% go run pnggen.go \n-- pnggen\/0.0.1 --\n-- created x.png (64 x 64)\n% file x.png\nx.png: PNG image data, 64 x 64, 1-bit grayscale, non-interlaced\n% od -c -t d1 x.png\n0000000  211   P   N   G  \\r  \\n 032  \\n  \\0  \\0  \\0  \\r   I   H   D   R\n         -119  80  78  71  13  10  26  10   0   0   0  13  73  72  68  82\n0000020   \\0  \\0  \\0   @  \\0  \\0  \\0   @ 001  \\0  \\0  \\0  \\0            \n            0   0   0  64   0   0   0  64   1   0   0   0   0    <\/code><\/pre>\n\n\n\n<p>\u3068\u308a\u3042\u3048\u305a file \u30b3\u30de\u30f3\u30c9\u306f\u3001\u3053\u308c\u304c 64 x 64 \u306ePNG\u3060\u3068\u8a8d\u8b58\u3057\u3066\u304f\u308c\u3066\u3044\u308b\u3002CRC\u306f\u307e\u3060\u3064\u3051\u3066\u306a\u3044\u3051\u3069\u3001\u30c1\u30a7\u30c3\u30af\u3057\u3066\u306a\u3044\u3093\u3060\u306a\u3002\u3067\u306f Preview \u3067\u958b\u3044\u3066\u307f\u3088\u3046\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"532\" height=\"263\" src=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-21.00.31.png\" alt=\"\" class=\"wp-image-2661\" srcset=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-21.00.31.png 532w, https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-21.00.31-300x148.png 300w\" sizes=\"(max-width: 532px) 100vw, 532px\" \/><\/figure>\n\n\n\n<p>\u304a\u3063\u3057\u3083\u308b\u3068\u304a\u308a\u3001\u30c0\u30e1\u30fc\u30b8\u3092\u53d7\u3051\u3066\u304a\u308a\u307e\u3059\u3002\u30d6\u30e9\u30a6\u30b6\u306f\u4f55\u3068\u8a00\u3046\u3060\u308d\u3046\uff1f<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"714\" height=\"235\" src=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-21.05.07.png\" alt=\"\" class=\"wp-image-2662\" srcset=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-21.05.07.png 714w, https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-21.05.07-300x99.png 300w\" sizes=\"(max-width: 714px) 100vw, 714px\" \/><\/figure>\n\n\n\n<p>Firefox\u306f\u6012\u3063\u305f\u3002\u304c\u3001\u4ed6\u306e\u30d6\u30e9\u30a6\u30b6\u305f\u3061\u306f\u30ce\u30fc\u30eb\u30c3\u30af\u3067\u30b9\u30eb\u30fc\u30d1\u30b9\u3002\u308f\u308a\u3068\u3044\u3044\u52a0\u6e1b\u306a\u3093\u3060\u306a\u3002<\/p>\n\n\n\n<p>\u3069\u3046\u3084\u3089\u5fc5\u9808\u30a8\u30ea\u30a2\u306f\u305d\u308d\u3063\u3066\u306a\u3044\u3068\u6012\u3089\u308c\u308b\u3088\u3046\u306a\u306e\u3067\u3001\u7a7a\u306e\u30d1\u30ec\u30c3\u30c8\u3068\u7a7a\u306e\u30a4\u30e1\u30fc\u30b8\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3057\u3066\u3001IEND\u3067\u7d42\u7aef\u3057\u3066\u307f\u308b\u3002\u3067\u3001\u30d7\u30ec\u30d3\u30e5\u30fc\u3067\u898b\u3066\u307f\u308b\u3068\u2026<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" width=\"377\" height=\"650\" src=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-22.41.30.png\" alt=\"\" class=\"wp-image-2667\" srcset=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-22.41.30.png 377w, https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-22.41.30-174x300.png 174w\" sizes=\"(max-width: 377px) 100vw, 377px\" \/><\/figure><\/div>\n\n\n\n<p>\u3067\u304d\u305f\u30fc\uff01\u82e6\u7bc06\u6642\u9593\uff08\u7b11\uff09\u534a\u5206\u4ee5\u4e0a\u306f\u3001Go\u8a00\u8a9e\u306e string \u578b\u3068\u306e\u95d8\u3044\u3060\u3063\u305f\u3002\u307e\u3060\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u3002\u305d\u3082\u305d\u3082\u306a\u305c\u3001printf \/ scanf \u3067\u30ca\u30de\u306e\u6574\u6570\u5024\u306e\u8aad\u307f\u66f8\u304d\u3001\u7279\u306b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d0\u30a4\u30c8\u30aa\u30fc\u30c0\u3068\u306e\u5909\u63db\u304c\u3067\u304d\u306a\u3044\u306e\u304b\u4e0d\u601d\u8b70\u3060\u3002\u306a\u305c\u305f\u304b\u304c hton \/ ntoh \u3059\u308b\u305f\u3081\u306b\u3001\u9762\u5012\u306a\u3053\u3068\u3092\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u306e\u304b\uff1f\uff1f<\/p>\n\n\n\n<p>\u3068\u3082\u3042\u308c\u3001\u6700\u5c0f\u306ePNG\u30d5\u30a1\u30a4\u30eb\u306f\u300165\u30d0\u30a4\u30c8\u3067\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u3063\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>% go run pnggen.go\n-- pnggen\/0.0.2 (PNG Generator) --\nCRC=82124C73\nCRC=4BA88955\nCRC=35AF061E\nCRC=AE426082\n-- created x2.png (64 x 64)\n\n% od -c x2.png\n0000000  211   P   N   G  \\r  \\n 032  \\n  \\0  \\0  \\0  \\r   I   H   D   R\n0000020   \\0  \\0  \\0   @  \\0  \\0  \\0   @ 001  \\0  \\0  \\0  \\0 202 022   L\n0000040    s  \\0  \\0  \\0  \\0   P   L   T   E   K 250 211   U  \\0  \\0  \\0\n0000060   \\0   I   D   A   T   5 257 006 036  \\0  \\0  \\0  \\0 256   B   `\n0000100  202   <\/code><\/pre>\n\n\n\n<p>\u3042\u308c\uff1fIEND\u304c\u51fa\u3066\u306a\u3044\u3084\u3002\u51fa\u529b\u3057\u5fd8\u308c\u305f\u3002Preview\u306e\u30c1\u30a7\u30c3\u30af\u3082\u4e2d\u9014\u534a\u7aef\u3060\u306a\u3002\u51fa\u529b\u3057\u3088\u3046\u3002\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u6700\u5c0f\u306ePNG\u30d5\u30a1\u30a4\u30eb\u306f\u300169\u30d0\u30a4\u30c8\u3067\u3042\u3063\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>% od -c x2.png\n0000000  211   P   N   G  \\r  \\n 032  \\n  \\0  \\0  \\0  \\r   I   H   D   R\n0000020   \\0  \\0  \\0   @  \\0  \\0  \\0   @ 001  \\0  \\0  \\0  \\0 202 022   L\n0000040    s  \\0  \\0  \\0  \\0   P   L   T   E   K 250 211   U  \\0  \\0  \\0\n0000060   \\0   I   D   A   T   5 257 006 036  \\0  \\0  \\0  \\0   I   E   N\n0000100    D 256   B   ` 202                                            \n0000105\n% od -t x1 x2.png\n0000000    89  50  4e  47  0d  0a  1a  0a  00  00  00  0d  49  48  44  52\n0000020    00  00  00  40  00  00  00  40  01  00  00  00  00  82  12  4c\n0000040    73  00  00  00  00  50  4c  54  45  4b  a8  89  55  00  00  00\n0000060    00  49  44  41  54  35  af  06  1e  00  00  00  00  49  45  4e\n0000100    44  ae  42  60  82                                            \n0000105<\/code><\/pre>\n\n\n\n<p>data URI \u306b\u3057\u3066\u307f\u3088\u3046\u3002\u307e\u305a\u306fbase64\u306b\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>% delegated -FenMime -b x2.png  \niVBORw0KGgoAAAANSUhEUgAAAEAAAABAAQAAAACCEkxzAAAAAFBMVEVLqIlVAAAAAElEQVQ1\nrwYeAAAAAElFTkSuQmCC<\/code><\/pre>\n\n\n\n<p>data URI \u306f\u3053\u308c\u3067\u826f\u3044\u306f\u305a\u3060\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABAAQAAAACCEkxzAAAAAFBMVEVLqIlVAAAAAElEQVQ1\nrwYeAAAAAElFTkSuQmCC<\/code><\/pre>\n\n\n\n<p>Opera\u306eURL\u7a93\u306b\u98df\u308f\u305b\u3066\u8868\u793a\u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3002Preview \u3067\u8868\u793a\u3002\u554f\u984c\u306a\u3057\u3002\u307f\u3093\u306a\u3067\u8a18\u5ff5\u64ae\u5f71\u3057\u3088\u3046\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"381\" src=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-23.20.34-1024x381.png\" alt=\"\" class=\"wp-image-2674\" srcset=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-23.20.34-1024x381.png 1024w, https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-23.20.34-300x112.png 300w, https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-23.20.34-768x286.png 768w, https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-18-at-23.20.34.png 1480w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>\u30df\u30cb\u30de\u30e0PNG\u30d5\u30a1\u30a4\u30eb\u3067\u304d\u307e\u3057\u305f\u3002<\/figcaption><\/figure>\n\n\n\n<p>\u3042\u308c\uff1f\u305d\u3046\u3044\u3084 zlib \u304b\u3051\u3066\u306a\u3044\u3093\u3060\u3051\u3069\u3001\u901a\u3063\u305f\u3058\u3083\u3093\u3002\u81ea\u52d5\u5224\u5225\u3057\u3066\u308b\u306e\u304b\u306a\uff1f\u3042\u3001\u5727\u7e2e\u3059\u308b\u306e\u306f\u30c7\u30fc\u30bf\u3060\u3051\u306a\u306e\u304b\u306a\u3002\u3068\u308a\u3042\u3048\u305a\u73fe\u72b6\u3092\u4fdd\u5b58\u3002<\/p>\n\n\n\n<p>\n<details>\n<summary>Pnggen\/0.0.2 (PNG Generator) \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/summary>\n<pre style=font-size:8pt;>\n\/\/\n\/\/ 2020-0518-02 pnggen\/0.0.2 (PNG generator) by ITS more :-)\n\/\/ Reference: https:\/\/www.w3.org\/TR\/PNG\/\n\/\/\npackage main\nimport (\n        \"os\"\n        \"fmt\"\n\t\"hash\/crc32\"\n)\nfunc myid() string {\n\treturn \"pnggen\/0.0.2 (PNG Generator)\"\n}\nfunc hton32b(i uint32)(string){\n\tbuf := make([]byte, 4)\n\tbuf[0] = byte(0xFF & (i >> 24))\n\tbuf[1] = byte(0xFF & (i >> 16))\n\tbuf[2] = byte(0xFF & (i >>  8))\n\tbuf[3] = byte(0xFF & (i))\n\treturn string(buf)\n}\nfunc putNetInt32(file *os.File, i32 uint32){\n        intb := make([]byte, 4)\n        ints := string(intb)\n        ints = \"\"\n        ints = hton32b(i32)\n        file.Write([]byte(ints))\n}\nfunc main() {\n        outfile := \"x2.png\"\n\tgenw := 64;\n\tgenh := 64;\n        fmt.Fprintf(os.Stderr,\"-- %s --\\n\",myid()) \n        file, _ := os.Create(outfile)\n        defer file.Close()\n        \n        PNGsignature := \"\\x89PNG\\r\\n\\x1A\\n\" \/\/ 5.2 PNG signature\n        file.Write([]byte(PNGsignature))\n        \n        \/\/ 5.3 Chunk fields := Length, (Chunk Type, Chunk Data), CRC\n        ckdbuf := make([]byte, 256) \/\/ 5.3 CHUNK DATA buffer\n        chunkd := string(ckdbuf)\n        \n\t\/\/--------------------------------- IHDR\n        \/\/ 11.2.2 IHDR Image header\n\t\/\/ https:\/\/www.w3.org\/TR\/PNG\/#11IHDR\n        IHDRtype := \"IHDR\" \/\/ IHDR chunk type\n\tchunkd = IHDRtype;\n        chunkd += hton32b(64) \/\/ Width\n        chunkd += hton32b(64) \/\/ Hight \n        chunkd += string(1) \/\/ Bit depth, 1 for monocrome\n        chunkd += string(0) \/\/ Color type, 0 for Grayscalse\n        chunkd += string(0) \/\/ Compression method, 0 for deflate\/inflate \n        chunkd += string(0) \/\/ Filter method, 0 for adaptive\n        chunkd += string(0) \/\/ Interlace method, 0 for no interlace\n\n        \/\/ 5.3 CRC - for chunk type and chunk data\n\tcrc := crc32.ChecksumIEEE([]byte(chunkd))\n\tfmt.Fprintf(os.Stderr,\"CRC=%X\\n\",crc)\n        putNetInt32(file,uint32(len(chunkd)-4)) \/\/ chunk data length, excluding type filed\n        file.Write([]byte(chunkd))\n\tputNetInt32(file,crc)\n\n\t\/\/--------------------------------- PLTE\n\t\/\/ 11.2.2.3 PLTE Pallete\n\t\/\/ https:\/\/www.w3.org\/TR\/PNG\/#11PLTE\n\tPLTEtype := \"PLTE\"\n\tchunkd = PLTEtype;\n\t\/\/ empty pallete\n\n\tcrc = crc32.ChecksumIEEE([]byte(chunkd))\n\tfmt.Fprintf(os.Stderr,\"CRC=%X\\n\",crc)\n        putNetInt32(file,uint32(len(chunkd)-4)) \/\/ chunk data length, excluding type filed\n        file.Write([]byte(chunkd))\n\tputNetInt32(file,crc)\n\n\t\/\/--------------------------------- IDAT\n\t\/\/ 11.2.2.4 IDAT Image data\n\tIDATtype := \"IDAT\"\n\tchunkd = IDATtype;\n\t\/\/ empty data\n\n\tcrc = crc32.ChecksumIEEE([]byte(chunkd))\n\tfmt.Fprintf(os.Stderr,\"CRC=%X\\n\",crc)\n        putNetInt32(file,uint32(len(chunkd)-4)) \/\/ chunk data length, excluding type filed\n        file.Write([]byte(chunkd))\n\tputNetInt32(file,crc)\n\n\t\/\/--------------------------------- IEND\n\t\/\/ 11.2.2.4 IEND Image trailer\n\tIENDtype := \"IEND\"\n\tchunkd = IENDtype;\n\n\tcrc = crc32.ChecksumIEEE([]byte(chunkd))\n\tfmt.Fprintf(os.Stderr,\"CRC=%X\\n\",crc)\n        putNetInt32(file,0) \/\/ chunk data length, excluding type filed\n        file.Write([]byte(chunkd))\n\tputNetInt32(file,crc)\n\n        fmt.Fprintf(os.Stderr,\"-- created %s (%d x %d)\\n\",outfile,genw,genh) \n}\n<\/pre>\n<\/details>\n<\/p>\n\n\n\n<p>2020-0518 SatoxITS<\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/go\u306b\u3088\u308bpng\u306e\u751f\u6210-\u2013-\u682a\u5f0f\u4f1a\u793e-ITS-more.pdf\">go\u306b\u3088\u308bpng\u306e\u751f\u6210-\u2013-\u682a\u5f0f\u4f1a\u793e-ITS-more<\/a><a href=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/go\u306b\u3088\u308bpng\u306e\u751f\u6210-\u2013-\u682a\u5f0f\u4f1a\u793e-ITS-more.pdf\" class=\"wp-block-file__button\" download>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a><\/div>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/go\u306b\u3088\u308bpng\u306e\u751f\u6210-\u2013-\u682a\u5f0f\u4f1a\u793e-ITS-more-1.pdf\">go\u306b\u3088\u308bpng\u306e\u751f\u6210-\u2013-\u682a\u5f0f\u4f1a\u793e-ITS-more-1<\/a><a href=\"https:\/\/its-more.jp\/ja_jp\/wp-content\/uploads\/2020\/05\/go\u306b\u3088\u308bpng\u306e\u751f\u6210-\u2013-\u682a\u5f0f\u4f1a\u793e-ITS-more-1.pdf\" class=\"wp-block-file__button\" download>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u30b5\u30fc\u30d0\u3067\u753b\u50cf\u3092\u751f\u6210\u3057\u3066\u914d\u4fe1\u3057\u305f\u3044\u3002\u307e\u305a\u306f\u9759\u6b62\u753b\u3067\u3001\u30a2\u30a4\u30b3\u30f3\u3001\u30b0\u30e9\u30d5\u3001QR\u30b3\u30fc\u30c9\u7b49\u3002\u9ad8\u3005100KB\u7a0b\u5ea6\u306e\u753b\u50cf\u3092\u60f3\u5b9a\u3057\u3066\u3044\u308b\u3002\u8981\u3059\u308b\u306b\u3001\u3069\u306e\u30d4\u30af\u30bb\u30eb\u3092\u4f55\u8272\u306b\u3059\u308b\u304b\u3001\u3060\u3051\u306e\u30c7\u30fc\u30bf\u306a\u306e\u3060\u304b\u3089\u3001\u7c21\u5358\u306b\u3067\u304d\u308b\u306b\u9055\u3044\u306a\u3044\u3002 PNG\u9078\u5b9a &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/its-more.jp\/ja_jp\/?p=2632\" class=\"more-link\"><span class=\"screen-reader-text\">\"go\u306b\u3088\u308bpng\u306e\u751f\u6210\" \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/its-more.jp\/ja_jp\/index.php?rest_route=\/wp\/v2\/posts\/2632"}],"collection":[{"href":"https:\/\/its-more.jp\/ja_jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/its-more.jp\/ja_jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/its-more.jp\/ja_jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/its-more.jp\/ja_jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2632"}],"version-history":[{"count":48,"href":"https:\/\/its-more.jp\/ja_jp\/index.php?rest_route=\/wp\/v2\/posts\/2632\/revisions"}],"predecessor-version":[{"id":2725,"href":"https:\/\/its-more.jp\/ja_jp\/index.php?rest_route=\/wp\/v2\/posts\/2632\/revisions\/2725"}],"wp:attachment":[{"href":"https:\/\/its-more.jp\/ja_jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/its-more.jp\/ja_jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/its-more.jp\/ja_jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}