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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

Please note there is currently a delay in replying to some post. See pinned thread in the Questions forum. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.