Jump to content
Sign in to follow this  
razerwolf

Path operation automation

Recommended Posts

I recently discovered that Affinity Designer will copy paths to the clipboard as SVG Documents, so I decided to use it for some simple automation.

 

I wrote a simple python script to simplify SVG paths: https://gist.github.com/NickBeeuwsaert/004851e7f7571b288f3c

 

And here is a example of it in action:

 

before:

 

9D7NfA2.png

 

Copy path with Command+V

 

execute on command line:

 

$ pbpaste | python svg_simplify.py | pbcopy

 

And then paste back into Affinity Designer:

 

 

GUxWwe4.png

I just thought it might be a cool tip for anyone who uses SVG optimization tools for web development...

 

I'd like to set up a Automator script to streamline it but Automator is acting up for me today :/

 

Also: If you have imagemagick and potrace installed (usually via brew), you can rasterize a image from AFD using this (after copying the image from AFD) using:

 

$ pbpaste | convert svg:- pnm:- | potrace -s - -o - | pbcopy

 

(P.S. I hope this is the right area of the forum to post...)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×