Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Photoshop Custom Shape to SVG path string

Is there any way to get the SVG path string off a Photoshop custom shape or path? Or is there another way to get/construct similar data? I'm looking to do something similar to this:

http://raphaeljs.com/icons/

like image 884
Will Haynes Avatar asked Mar 24 '11 01:03

Will Haynes


People also ask

Can you convert a shape to a path in Photoshop?

Converting a shape into a path in Photoshop is a quick and easy way to create custom shapes or text elements. Simply select the shape with the Selection tool, go to the Edit menu, and choose Define Custom Shape. Then, go to the Paths panel and click on the Make Work Path from Selection button.

How do I create a custom path in Photoshop?

Choose the Pen tool on the toolbox. Select the drawing option from the options bar to draw either a path, Shape layer or fill pixels. Click once to mark the starting point, then Ctrl-click Cmd-click) somewhere else (without dragging) to mark the ending point. A straight line connects the dots.


2 Answers

Update: in recent versions of Photoshop, there is a built-in option to export the image as SVG, which works well on paths and custom shapes. Just do:

File -> Export -> Export as... and select SVG in the file settings.

Original Answer:

Starting from Photoshop CC 14.2, you can create SVG files directly from Photoshop:

  1. Create a file named generator.json with the content below in your user home folder.
  2. Restart Photoshop and open your PSD file.
  3. Activate the generator: File > Generate > Image Assets.
  4. Rename your layer to <something>.svg.
  5. The svg file will be created in the assets directory next to your PSD file.

Content for generator.json:

{     "generator-assets":  {          "svg-enabled": true     } } 

Source: http://creativedroplets.com/generate-svg-with-photoshop-cc-beta/

like image 55
Tzach Avatar answered Oct 04 '22 13:10

Tzach


  1. Select and copy the path in Photoshop
  2. Launch Adobe Illustrator
  3. Create a new Document
  4. Paste
  5. Save as SVG

If you have Illustrator and have not created all the paths, however, it is probably easier to create them directly in Illustrator.

If you do not have Illustrator, you are probably better off using the free Inkscape SVG editor to draw your paths.

If you do already have the paths in Photoshop, and do not have Illustrator, the best I can think of is to turn on the Info palette in Photoshop select the path points one at a time and manually record the positions of the point itself as well as its handles, and from those manually create the path using absolute curveto commands, 'C' (for the points with handles) and absolute lineto commands, 'L' for those points that have no handles.

like image 35
Phrogz Avatar answered Oct 04 '22 11:10

Phrogz