{"id":113455,"date":"2024-03-22T21:27:11","date_gmt":"2024-03-22T12:27:11","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b\/"},"modified":"2024-04-05T23:16:55","modified_gmt":"2024-04-05T14:16:55","slug":"python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b\/","title":{"rendered":"Python\u3092\u4f7f\u7528\u3057\u3066\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db"},"content":{"rendered":"<p>PIL\u30e9\u30a4\u30d6\u30e9\u30ea\u306econvert()\u95a2\u6570\u3092\u4f7f\u3063\u3066\u30ab\u30e9\u30fc\u753b\u50cf\u3092\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u3067\u3001\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306e\u753b\u50cf\u3092\u751f\u6210\u3067\u304d\u307e\u3059\u3002\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"hljs-keyword\">from<\/span> PIL <span class=\"hljs-keyword\">import<\/span> Image\r\n\r\n<span class=\"hljs-comment\"># \u6253\u5f00\u5f69\u8272\u56fe\u50cf<\/span>\r\nimage = Image.<span class=\"hljs-built_in\">open<\/span>(<span class=\"hljs-string\">'color_image.jpg'<\/span>)\r\n\r\n<span class=\"hljs-comment\"># \u8f6c\u6362\u4e3a\u7070\u5ea6\u56fe\u50cf<\/span>\r\ngray_image = image.convert(<span class=\"hljs-string\">'L'<\/span>)\r\n\r\n<span class=\"hljs-comment\"># \u663e\u793a\u7070\u5ea6\u56fe\u50cf<\/span>\r\ngray_image.show()\r\n\r\n<span class=\"hljs-comment\"># \u4fdd\u5b58\u7070\u5ea6\u56fe\u50cf<\/span>\r\ngray_image.save(<span class=\"hljs-string\">'gray_image.jpg'<\/span>)\r\n<\/code><\/pre>\n<p>\u4e0a\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u307e\u305aImage.open()\u95a2\u6570\u3067\u30ab\u30e9\u30fc\u753b\u50cf\u3092\u958b\u304d\u307e\u3059\uff08color_image.jpg\u3092\u3001\u3054\u81ea\u8eab\u304c\u304a\u6301\u3061\u306e\u30ab\u30e9\u30fc\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u306b\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\uff09\uff0e\u6b21\u306b\u3001convert()\u95a2\u6570\u3067\u753b\u50cf\u3092\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u753b\u50cf\u306b\u5909\u63db\u3057\u307e\u3059\uff0e\u5f15\u6570\u306e&#8217;L&#8217;\u306f\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u753b\u50cf\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\uff0e\u6700\u5f8c\u306b\u3001show()\u95a2\u6570\u3067\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u753b\u50cf\u3092\u8868\u793a\u3057\u3001save()\u95a2\u6570\u3067\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u753b\u50cf\u3092\u4fdd\u5b58\u3057\u307e\u3059\uff08gray_image.jpg\u306f\u3054\u81ea\u8eab\u3067\u4fdd\u5b58\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u3068\u30d5\u30a1\u30a4\u30eb\u540d\u306b\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\uff09\uff0e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PIL\u30e9\u30a4\u30d6\u30e9\u30ea\u306econvert()\u95a2\u6570\u3092\u4f7f\u3063\u3066\u30ab\u30e9\u30fc\u753b\u50cf\u3092\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u3067\u3001\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306e\u753b\u50cf\u3092\u751f\u6210\u3067\u304d\u307e\u3059\u3002\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002 from PIL import Image # \u6253\u5f00 [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-113455","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python\u3092\u4f7f\u7528\u3057\u3066\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/python\u3092\u4f7f\u7528\u3057\u3066\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python\u3092\u4f7f\u7528\u3057\u3066\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db\" \/>\n<meta property=\"og:description\" content=\"PIL\u30e9\u30a4\u30d6\u30e9\u30ea\u306econvert()\u95a2\u6570\u3092\u4f7f\u3063\u3066\u30ab\u30e9\u30fc\u753b\u50cf\u3092\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u3067\u3001\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306e\u753b\u50cf\u3092\u751f\u6210\u3067\u304d\u307e\u3059\u3002\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002 from PIL import Image # \u6253\u5f00 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/python\u3092\u4f7f\u7528\u3057\u3066\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-22T12:27:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-05T14:16:55+00:00\" \/>\n<meta name=\"author\" content=\"\u84ee, \u7ffc\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u84ee, \u7ffc\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b\/\",\"name\":\"Python\u3092\u4f7f\u7528\u3057\u3066\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2024-03-22T12:27:11+00:00\",\"dateModified\":\"2024-04-05T14:16:55+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\u3092\u4f7f\u7528\u3057\u3066\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413\",\"name\":\"\u84ee, \u7ffc\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g\",\"caption\":\"\u84ee, \u7ffc\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/rentsubasa\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python\u3092\u4f7f\u7528\u3057\u3066\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/python\u3092\u4f7f\u7528\u3057\u3066\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db\/","og_locale":"ja_JP","og_type":"article","og_title":"Python\u3092\u4f7f\u7528\u3057\u3066\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db","og_description":"PIL\u30e9\u30a4\u30d6\u30e9\u30ea\u306econvert()\u95a2\u6570\u3092\u4f7f\u3063\u3066\u30ab\u30e9\u30fc\u753b\u50cf\u3092\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u3067\u3001\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306e\u753b\u50cf\u3092\u751f\u6210\u3067\u304d\u307e\u3059\u3002\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002 from PIL import Image # \u6253\u5f00 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/python\u3092\u4f7f\u7528\u3057\u3066\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2024-03-22T12:27:11+00:00","article_modified_time":"2024-04-05T14:16:55+00:00","author":"\u84ee, \u7ffc","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u84ee, \u7ffc"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b\/","name":"Python\u3092\u4f7f\u7528\u3057\u3066\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2024-03-22T12:27:11+00:00","dateModified":"2024-04-05T14:16:55+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Python\u3092\u4f7f\u7528\u3057\u3066\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u306b\u5909\u63db"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413","name":"\u84ee, \u7ffc","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g","caption":"\u84ee, \u7ffc"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/rentsubasa\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%ab%e3%81%ab%e5%a4%89%e6%8f%9b\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/113455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=113455"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/113455\/revisions"}],"predecessor-version":[{"id":324710,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/113455\/revisions\/324710"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=113455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=113455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=113455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}