New stack for SVG tracing / widget path creation
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 253
- Joined: Wed Aug 19, 2015 4:29 pm
New stack for SVG tracing / widget path creation
I've created a simple stack, which is currently working in ubuntu 18.04.
This stack requires ImageMagick and Potrace be installed on the host system.
You can add a single bitmap file, or a folder of images to the file list.
The "trace" button will prepare the image with the settings from the tolerance and radius fields using mkbitmap, which is part of potrace, and then show the traced image in the preview area. If it is suitable, you can use the "save svg" button to save to your desired location, or click the "get path for widget" button to have an SVG widget friendly path copied to your clipboard, ready to be pasted into a new SVG widget.
The QuickTrace button will trace the selected image with the default potrace settings, and can be saved or copied to clipboard for use as a widget path as well.
The trace all and quick trace all buttons will trace every image in the list and save to your desired location.
I hope somebody finds this useful.
This stack requires ImageMagick and Potrace be installed on the host system.
You can add a single bitmap file, or a folder of images to the file list.
The "trace" button will prepare the image with the settings from the tolerance and radius fields using mkbitmap, which is part of potrace, and then show the traced image in the preview area. If it is suitable, you can use the "save svg" button to save to your desired location, or click the "get path for widget" button to have an SVG widget friendly path copied to your clipboard, ready to be pasted into a new SVG widget.
The QuickTrace button will trace the selected image with the default potrace settings, and can be saved or copied to clipboard for use as a widget path as well.
The trace all and quick trace all buttons will trace every image in the list and save to your desired location.
I hope somebody finds this useful.
- Attachments
-
- EasyVectorTrace.zip
- (58.54 KiB) Downloaded 408 times
Last edited by ClipArtGuy on Thu Aug 30, 2018 4:33 pm, edited 1 time in total.
Re: New stack for SVG tracing / widget path creation
Looks interesting!
All of the following came after opening in Lc 8.1.4 on Linux Mint 18.x
I saw you included lines for handling .png and .jpg files, so I tried opening .jpg next. It got a bit further (showed the 'running' swirly animation thingie and got through the trace routine ) but ultimately failed with this error:
I didn't continue tracing to see where exactly it failed, sorry, but I hope that helps you out somehow.
All of the following came after opening in Lc 8.1.4 on Linux Mint 18.x
I think you might have a logic error or incomplete structuring in the 'mouseDown' handler of field "fileList" where .bmp files are concerned. It reaches that point and eliminates the listing from the field, but doesn't give any reasons 'why' (no warning dialog, etc. )ClipArtGuy wrote: ↑Thu Aug 30, 2018 2:43 amYou can add a single bitmap file, or a folder of images to the file list.
I saw you included lines for handling .png and .jpg files, so I tried opening .jpg next. It got a bit further (showed the 'running' swirly animation thingie and got through the trace routine ) but ultimately failed with this error:
Code: Select all
button "Add File": execution error at line 6 (Chunk: no such object), char 8
-
- Posts: 253
- Joined: Wed Aug 19, 2015 4:29 pm
Re: New stack for SVG tracing / widget path creation
The stack was created in LC 9.0 RC2, and seems to be running fine on both of my test machines....
Re: New stack for SVG tracing / widget path creation
Well, that is something to know
-
- Posts: 253
- Joined: Wed Aug 19, 2015 4:29 pm
-
- Posts: 253
- Joined: Wed Aug 19, 2015 4:29 pm
Re: New stack for SVG tracing / widget path creation
It also seems so be working as expected here in 8.1.4.... I'm not sure why it is throwing that error in Mint...
-
- Posts: 253
- Joined: Wed Aug 19, 2015 4:29 pm
Re: New stack for SVG tracing / widget path creation
EDIT: I've added a line to the filelist field to aslo accept BMP files. It had been set to only recognize jpg and png files, as that is what I mostly use this stack to trace. It should keep them in the file list now.ClipArtGuy wrote: ↑Thu Aug 30, 2018 4:10 pmIt also seems so be working as expected here in 8.1.4.... I'm not sure why it is throwing that error in Mint...
Re: New stack for SVG tracing / widget path creation
Will try to test it out some more later today if i get the time
-
- Posts: 253
- Joined: Wed Aug 19, 2015 4:29 pm
Re: New stack for SVG tracing / widget path creation
I appreciate it. In the meantime, here is a short video of this stack working as expected in Ubuntu 18.04:
https://youtu.be/DOGktwiStHY
Re: New stack for SVG tracing / widget path creation
Working here now, very slick ClipArtGuy
-
- Posts: 253
- Joined: Wed Aug 19, 2015 4:29 pm
Re: New stack for SVG tracing / widget path creation
Thanks! I've got a version that is also working in Windows, but it requires that either imagemagick and potrace be available in the enviromental path, or that potrace.exe, convert.exe, and mkbitmap.exe are in the TempTrace folder created by the stack.
Other than that, a quick find and replace "rm with "del in the whole stack, and it seems to be working just as well in WIn 10.
I haven't had a mac since the 1990's, so I am unable to see if I can get it working there......
Re: New stack for SVG tracing / widget path creation
I would give it a shot, but the only osx vers. I have is 10.6.5 or so, Lc 9.x won't run on it. I'll see if it will the highest version I can put on there, which I think is 8.x.ClipArtGuy wrote: ↑Thu Aug 30, 2018 5:14 pmI haven't had a mac since the 1990's, so I am unable to see if I can get it working there......
for my own reference later wrote: Install Potrace on OSX
- Press Command+Space and type Terminal and press enter/return key.
- Run in Terminal app:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homeb ... er/install)" < /dev/null 2> /dev/null
and press enter/return key.- If the screen prompts you to enter a password, please enter your Mac's user password to continue. When you type the password, it won't be displayed on screen, but the system would accept it. So just type your password and press ENTER/RETURN key. Then wait for the command to finish.
- Run:
brew install potrace
-
- Posts: 253
- Joined: Wed Aug 19, 2015 4:29 pm
Re: New stack for SVG tracing / widget path creation
It appears to be working here in 8.1.4 on Ubuntu, despite being saved in a newer version, so that may or may not be a problem. I appreciate the help. This stack has been super useful to me the last few months, so I'd like to iron out all the kinks and upload to the sample stacks eventually.
sidenote: any filename that contain parenthesis will be removed from the fileList, as I had trouble building the shell command using files with names that contained them.
-
- Posts: 253
- Joined: Wed Aug 19, 2015 4:29 pm
Re: New stack for SVG tracing / widget path creation
Here is a link to a working windows version of this stack. The required elements of Potrace and Imagemagick are in the tempTrace folder relative to the stack. As long as they are, this stack should be fairly portable, but they can safely be deleted if ImagMagick and Potrace are in your environment path.
https://www.dropbox.com/s/zr5eqg5kwirbi ... t.zip?dl=0
https://www.dropbox.com/s/zr5eqg5kwirbi ... t.zip?dl=0
Re: New stack for SVG tracing / widget path creation
Turns out that wasn't the problem (I have 8.1.8 on that system). The real hurdle that I could not overcome was getting ImageMagick installed After several hours, I'm throwing in the towel on that one. Hopefully, someone else may already have the needed combo installed (Potrace was no issue to install).ClipArtGuy wrote: ↑Thu Aug 30, 2018 6:47 pmIt appears to be working here in 8.1.4 on Ubuntu, despite being saved in a newer version, so that may or may not be a problem.