{"id":97,"date":"2011-01-06T13:31:00","date_gmt":"2011-01-06T13:31:00","guid":{"rendered":"https:\/\/www.root42.de\/blog\/?p=97"},"modified":"2011-01-06T13:31:00","modified_gmt":"2011-01-06T13:31:00","slug":"imagemagick-convert-rgba-to-rgb-in-a-sane-way","status":"publish","type":"post","link":"https:\/\/www.root42.de\/blog\/?p=97","title":{"rendered":"ImageMagick: Convert RGBA to RGB in a sane way"},"content":{"rendered":"<p>When using <a href=\"http:\/\/www.imagemagick.org\/\">ImageMagick<\/a> to convert an RGBA picture (e.g. an OS X window with shadows) to an RGB JPEG file, you should use the following command:<\/p>\n<p><span style=\"font-family: 'Courier New', Courier, monospace;\">$ convert input.png -flatten +matte output.jpg<\/span><\/p>\n<p>If you don&#8217;t do that, you will end up with a picture like this:<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"http:\/\/2.bp.blogspot.com\/_Mc79Xvd2xvE\/TSXD-8oFdUI\/AAAAAAAAAZA\/HOmAme_pVhY\/s1600\/time2.jpg\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" border=\"0\" height=\"113\" src=\"http:\/\/2.bp.blogspot.com\/_Mc79Xvd2xvE\/TSXD-8oFdUI\/AAAAAAAAAZA\/HOmAme_pVhY\/s320\/time2.jpg\" width=\"320\" \/><\/a><\/div>\n<p>The right conversion leads to this result instead:<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"http:\/\/4.bp.blogspot.com\/_Mc79Xvd2xvE\/TSXEEA4J-BI\/AAAAAAAAAZE\/-Zvl3gij7xc\/s1600\/timemachine.jpg\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" border=\"0\" height=\"113\" src=\"http:\/\/4.bp.blogspot.com\/_Mc79Xvd2xvE\/TSXEEA4J-BI\/AAAAAAAAAZE\/-Zvl3gij7xc\/s320\/timemachine.jpg\" width=\"320\" \/><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>When using ImageMagick to convert an RGBA picture (e.g. an OS X window with shadows) to an RGB JPEG file, you should use the following command: $ convert input.png -flatten +matte output.jpg If you don&#8217;t do that, you will end up with a picture like this: The right conversion leads to this result instead:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[74,24,10],"tags":[],"_links":{"self":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/97"}],"collection":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=97"}],"version-history":[{"count":0,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}