{"id":83,"date":"2008-08-04T20:09:21","date_gmt":"2008-08-05T03:09:21","guid":{"rendered":"https:\/\/www.wkiri.com\/today\/?p=83"},"modified":"2008-08-04T20:09:21","modified_gmt":"2008-08-05T03:09:21","slug":"separate-out-individual-colors-in-an-image","status":"publish","type":"post","link":"https:\/\/www.wkiri.com\/today\/?p=83","title":{"rendered":"Separate out Individual Colors in an Image"},"content":{"rendered":"<p><a href=\"http:\/\/www.imagemagick.org\/script\/convert.php\">ImageMagick&#8217;s convert utility<\/a> is the Swiss-Army knife of command-line image editing.  I won&#8217;t get into all of the amazing tricks it can accomplish (you can even make animations and anaglyphs), but instead share a cool new thing I learned to do with it today.  This command will generate a grayscale image that contains only the values from the &#8220;channel&#8221; you specify (R, G, B):<\/p>\n<blockquote><p>\nconvert colorimage.jpg -channel R -separate grayimage-red.jpg<br \/>\nconvert colorimage.jpg -channel G -separate grayimage-green.jpg<br \/>\nconvert colorimage.jpg -channel B -separate grayimage-blue.jpg\n<\/p><\/blockquote>\n<p>So for example, you can take this good-looking guy:<br \/>\n<center><img decoding=\"async\" src=\"https:\/\/www.wkiri.com\/share\/photos\/Frodo05.jpg\"><\/center><br \/>\nand split him into<\/p>\n<table>\n<tr>\n<td>Red<\/td>\n<td>Green<\/td>\n<td>Blue<\/td>\n<\/tr>\n<tr>\n<td><img decoding=\"async\" width=150 src=\"https:\/\/www.wkiri.com\/share\/photos\/Frodo05-R.jpg\"><\/td>\n<td><img decoding=\"async\" width=150 src=\"https:\/\/www.wkiri.com\/share\/photos\/Frodo05-G.jpg\"><\/td>\n<td><img decoding=\"async\" width=150 src=\"https:\/\/www.wkiri.com\/share\/photos\/Frodo05-B.jpg\"><\/td>\n<\/tr>\n<\/table>\n<p>You may be surprised to learn that this has direct bearing on my Geology Master&#8217;s thesis.  I&#8217;m analyzing grayscale images of layered rocks to determine if they contain evidence of past life&#8212;and the way you convert from color to grayscale may matter (we&#8217;re going to test this).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ImageMagick&#8217;s convert utility is the Swiss-Army knife of command-line image editing. I won&#8217;t get into all of the amazing tricks it can accomplish (you can even make animations and anaglyphs), but instead share a cool new thing I learned to do with it today. This command will generate a grayscale image that contains only the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[23],"tags":[],"_links":{"self":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/posts\/83"}],"collection":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=83"}],"version-history":[{"count":0,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/posts\/83\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}