{"id":849,"date":"2011-10-11T23:03:59","date_gmt":"2011-10-11T12:03:59","guid":{"rendered":"http:\/\/www.madox.net\/blog\/?p=849"},"modified":"2011-11-16T08:48:42","modified_gmt":"2011-11-15T21:48:42","slug":"image-to-svg-cutout-script","status":"publish","type":"post","link":"https:\/\/www.madox.net\/blog\/2011\/10\/11\/image-to-svg-cutout-script\/","title":{"rendered":"Image to SVG Cutout Script"},"content":{"rendered":"<p>I wrote a quickie script to take advantage of Ponoko&#8217;s free cardboard special last month and the test results have arrived! \u00a0I can&#8217;t wait until daylight to share the results so here are some photos! \u00a0Script source at the end&#8230;<\/p>\n<figure id=\"attachment_851\" aria-describedby=\"caption-attachment-851\" style=\"width: 450px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.madox.net\/blog\/wp-content\/uploads\/2011\/10\/DSC06807.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-851\" title=\"Projection Test\" src=\"http:\/\/www.madox.net\/blog\/wp-content\/uploads\/2011\/10\/DSC06807-450x299.jpg\" alt=\"\" width=\"450\" height=\"299\" srcset=\"https:\/\/www.madox.net\/blog\/wp-content\/uploads\/2011\/10\/DSC06807-450x299.jpg 450w, https:\/\/www.madox.net\/blog\/wp-content\/uploads\/2011\/10\/DSC06807-1024x681.jpg 1024w\" sizes=\"auto, (max-width: 450px) 85vw, 450px\" \/><\/a><figcaption id=\"caption-attachment-851\" class=\"wp-caption-text\">Cute isn&#39;t she? <\/figcaption><\/figure>\n<p><!--more--><\/p>\n<p>The Python script generates squares and circles for each pixel in a photo, I was\u00a0targeting <a href=\"http:\/\/www.ponoko.com\/\">Ponoko<\/a>&#8216;s P2 size\u00a0so planned for 64&#215;64 pixel images at approximately 6mm per pixel. \u00a0The above shows an &#8216;inverted&#8217; generation where the lighter colours generate a cutout, this is intended for light being projected through it onto a surface. \u00a0Was hoping to use the sun for best effect but just used a cheap Ikea lamp to take the above photo.<\/p>\n<p>The normal generation is where darker colours generate a cutout, intended for placing the cutout on top of a coloured background. \u00a0In the photo below, the background is my table tennis table.<\/p>\n<p><a href=\"http:\/\/www.madox.net\/blog\/wp-content\/uploads\/2011\/10\/DSC06803A.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-853\" title=\"Hehehe she is cute :)\" src=\"http:\/\/www.madox.net\/blog\/wp-content\/uploads\/2011\/10\/DSC06803A-450x480.jpg\" alt=\"\" width=\"450\" height=\"480\" srcset=\"https:\/\/www.madox.net\/blog\/wp-content\/uploads\/2011\/10\/DSC06803A-450x480.jpg 450w, https:\/\/www.madox.net\/blog\/wp-content\/uploads\/2011\/10\/DSC06803A-959x1024.jpg 959w\" sizes=\"auto, (max-width: 450px) 85vw, 450px\" \/><\/a><\/p>\n<p>I barely unpacked the stuff from Ponoko before taking those photos so still need a bit of clean up (some &#8216;holes&#8217; still have the cardboard attached) but overall I&#8217;m happy with the result! \u00a0In case anyone is wondering, the &#8216;square&#8217; cutouts are much cheaper than the circular ones based on Ponoko pricing and achieve the same result.<\/p>\n<p>The script source can be found at at the link below, feel free to share.<\/p>\n<p>Script source :\u00a0<a href=\"http:\/\/code.google.com\/p\/madox\/source\/browse\/trunk\/misc\/im2svg.py\">http:\/\/code.google.com\/p\/madox\/source\/browse\/trunk\/misc\/im2svg.py<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Edit : New picture using day (Sun) lighting<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/lh6.googleusercontent.com\/-_MZp6jB-n2g\/TpTJi16KHFI\/AAAAAAAAA6U\/a0kN6tCmVIE\/s800\/11%252520-%2525201.jpg\" alt=\"\" width=\"800\" height=\"478\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wrote a quickie script to take advantage of Ponoko&#8217;s free cardboard special last month and the test results have arrived! \u00a0I can&#8217;t wait until daylight to share the results so here are some photos! \u00a0Script source at the end&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-849","post","type-post","status-publish","format-standard","hentry","category-engineering"],"_links":{"self":[{"href":"https:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/posts\/849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/comments?post=849"}],"version-history":[{"count":2,"href":"https:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/posts\/849\/revisions"}],"predecessor-version":[{"id":870,"href":"https:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/posts\/849\/revisions\/870"}],"wp:attachment":[{"href":"https:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/media?parent=849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/categories?post=849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/tags?post=849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}