{"id":5962,"date":"2013-04-26T01:18:49","date_gmt":"2013-04-26T05:18:49","guid":{"rendered":"http:\/\/www.useragentman.com\/blog\/?p=5962"},"modified":"2013-05-13T11:58:18","modified_gmt":"2013-05-13T15:58:18","slug":"how-to-create-svg-paths-easily-using-the-gimp","status":"publish","type":"post","link":"http:\/\/www.useragentman.com\/blog\/2013\/04\/26\/how-to-create-svg-paths-easily-using-the-gimp\/","title":{"rendered":"How To Create SVG Paths Easily Using The GIMP"},"content":{"rendered":"<p>When writing my blog post about <a href=\"https:\/\/www.useragentman.com\/blog\/2013\/04\/26\/clicking-through-clipped-images-using-css-pointer-events-svg-paths-and-vml\/\">Clicking Through Clipped Images Using CSS Pointer Events, SVG Paths and VML<\/a>, I needed to figure out how to create <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/SVG\/Tutorial\/Paths\">SVG paths<\/a> from scratch.  The problem is that they look so complicated and are not intuitive enough to produce by hand.  However,  I came across a cheap and simple way of creating SVG paths using the GIMP. <strong>People tell me I am also cheap and simple,<\/strong> so maybe that is why I love this solution so much. So, for the rest of you like-minded people, I would like to share this with you.  :-)<\/p>\n<ol>\n<li>Open the image you want to edit and use the select tools to remove parts of the image until you get the shape that you want to produce with your SVG path:<br \/>\n<img decoding=\"async\" src=\"\/tests\/pointerEvents\/images\/steps\/step1a-cut-out-hole.jpg\" \/><\/li>\n<li>Next use the magic wand to select all the areas that you just cut out.<br \/>\n<img decoding=\"async\" src=\"\/tests\/pointerEvents\/images\/steps\/step1b-magic-wand.jpg\" \/><\/li>\n<li>Now go to the <strong>Invert<\/strong> item from the <strong>Select<\/strong> menu.<br \/>\n<img decoding=\"async\" src=\"\/tests\/pointerEvents\/images\/steps\/step1beta-select-invert.jpg\" \/><br \/>\nThis will make the selection tool take the shape of the painted area, as opposed to the transparent area.<\/li>\n<li>Now choose <strong>To Path<\/strong> from the <strong>Select<\/strong> menu.<br \/>\n<img decoding=\"async\" src=\"\/tests\/pointerEvents\/images\/steps\/step1c-to-path.jpg\" \/><\/li>\n<li>In the <strong>Paths<\/strong> window, you will see a path has been created (it should be called <strong>Selection<\/strong>.  Right click on the path and choose <strong>Export Path<\/strong><br \/>\n<img decoding=\"async\" src=\"\/tests\/pointerEvents\/images\/steps\/step1d-export-path.jpg\" \/><\/li>\n<li>Save the path on the filesystem.<br \/>\n<img decoding=\"async\" src=\"\/tests\/pointerEvents\/images\/steps\/step1e-save-path.jpg\" \/><\/li>\n<\/ol>\n<p>If you have done this correctly, you&#8217;ll see this nice fresh snippet of SVG when you open up the file you just saved in a text editor:<\/p>\n<blockquote class=\"code\">\n<pre>\r\n&lt;?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?&gt;\r\n&lt;!DOCTYPE svg PUBLIC \"-\/\/W3C\/\/DTD SVG 20010904\/\/EN\"\r\n              \"http:\/\/www.w3.org\/TR\/2001\/REC-SVG-20010904\/DTD\/svg10.dtd\"&gt;\r\n\r\n&lt;svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\r\n     width=\"4.95in\" height=\"4.17in\"\r\n     viewBox=\"0 0 495 417\"&gt;\r\n  &lt;path id=\"Selection#4\"\r\n        fill=\"none\" stroke=\"black\" stroke-width=\"1\"\r\n        d=\"<span class=\"hilite\">M 495.00,0.00\r\n           C 495.00,0.00 495.00,417.00 495.00,417.00\r\n             495.00,417.00 0.00,417.00 0.00,417.00\r\n             0.00,417.00 0.00,0.00 0.00,0.00\r\n             0.00,0.00 495.00,0.00 495.00,0.00 Z\r\n           M 81.18,219.39\r\n           C 75.28,224.66 73.26,233.55 71.61,241.00\r\n             68.81,256.26 68.66,271.70 71.61,287.00\r\n             72.76,294.37 74.47,301.98 79.68,307.70\r\n             85.29,313.85 91.52,314.81 99.00,316.73\r\n             99.00,316.73 126.00,321.96 126.00,321.96\r\n             126.00,321.96 134.00,321.96 134.00,321.96\r\n             134.00,321.96 144.00,323.00 144.00,323.00\r\n             156.04,323.14 168.13,322.58 180.00,320.39\r\n             187.27,319.04 193.58,317.17 198.20,310.91\r\n             202.27,305.40 200.54,300.30 201.28,294.00\r\n             201.28,294.00 202.00,244.00 202.00,244.00\r\n             201.98,234.15 201.61,228.06 192.91,221.85\r\n             187.58,218.04 176.56,216.51 170.00,215.41\r\n             153.07,212.57 126.99,210.70 110.00,212.28\r\n             101.11,213.56 88.05,213.25 81.18,219.39 Z<\/span>\" \/&gt;\r\n&lt;\/svg&gt;\r\n<\/pre>\n<\/blockquote>\n<p>Note the highlighted bit.  This is an SVG path.<\/li>\n<\/ol>\n<p>To see how I use these paths, take a look at my companion article <a href=\"https:\/\/www.useragentman.com\/blog\/2013\/04\/26\/clicking-through-clipped-images-using-css-pointer-events-svg-paths-and-vml\/\">Clicking Through Clipped Images Using CSS Pointer Events, SVG Paths and VML<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2013\/04\/gimp-path.jpg\" \/> When writing my blog post about <a href=\"https:\/\/www.useragentman.com\/blog\/2013\/04\/26\/clicking-through-clipped-images-using-css-pointer-events-svg-paths-and-vml\/\">Clicking Through Clipped Images Using CSS Pointer Events, SVG Paths and VML<\/a>, I needed to create SVG paths.  The problem is that they look so complicated and are not intuitive enough to produce by hand.  However,  I came across a cheap and simple way of creating SVG paths using the GIMP. People tell me I am also cheap and simple, so maybe that is why I love this solution so much (It takes only six simple steps!) So, for the rest of you like-minded people, I would like to share it this solution with you.  <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5962","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/posts\/5962","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/comments?post=5962"}],"version-history":[{"count":25,"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/posts\/5962\/revisions"}],"predecessor-version":[{"id":6035,"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/posts\/5962\/revisions\/6035"}],"wp:attachment":[{"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/media?parent=5962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/categories?post=5962"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/tags?post=5962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}