New stack for SVG tracing / widget path creation

Deploying to Linux? Get penguinated here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

ClipArtGuy
Posts: 253
Joined: Wed Aug 19, 2015 4:29 pm

New stack for SVG tracing / widget path creation

Post by ClipArtGuy » Thu Aug 30, 2018 2:43 am

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.
easyvectortrace.jpg
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 331 times
Last edited by ClipArtGuy on Thu Aug 30, 2018 4:33 pm, edited 1 time in total.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: New stack for SVG tracing / widget path creation

Post by bogs » Thu Aug 30, 2018 3:02 pm

Looks interesting!

All of the following came after opening in Lc 8.1.4 on Linux Mint 18.x
ClipArtGuy wrote:
Thu Aug 30, 2018 2:43 am
You can add a single bitmap file, or a folder of images to the file list.
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. )

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 :wink: ) but ultimately failed with this error:

Code: Select all

button "Add File": execution error at line 6 (Chunk: no such object), char 8
I didn't continue tracing to see where exactly it failed, sorry, but I hope that helps you out somehow.
Image

ClipArtGuy
Posts: 253
Joined: Wed Aug 19, 2015 4:29 pm

Re: New stack for SVG tracing / widget path creation

Post by ClipArtGuy » Thu Aug 30, 2018 3:45 pm

The stack was created in LC 9.0 RC2, and seems to be running fine on both of my test machines....

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: New stack for SVG tracing / widget path creation

Post by bogs » Thu Aug 30, 2018 4:03 pm

Well, that is something to know :)
Image

ClipArtGuy
Posts: 253
Joined: Wed Aug 19, 2015 4:29 pm

Re: New stack for SVG tracing / widget path creation

Post by ClipArtGuy » Thu Aug 30, 2018 4:05 pm

bogs wrote:
Thu Aug 30, 2018 4:03 pm
Well, that is something to know :)
Yeah I probably should have said that in the OP. I am downloading 8.1.4 now to see if I get the same error.

ClipArtGuy
Posts: 253
Joined: Wed Aug 19, 2015 4:29 pm

Re: New stack for SVG tracing / widget path creation

Post by ClipArtGuy » Thu Aug 30, 2018 4:10 pm

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...

ClipArtGuy
Posts: 253
Joined: Wed Aug 19, 2015 4:29 pm

Re: New stack for SVG tracing / widget path creation

Post by ClipArtGuy » Thu Aug 30, 2018 4:15 pm

ClipArtGuy wrote:
Thu Aug 30, 2018 4:10 pm
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...
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.
EasyVectorTrace.zip
(58.54 KiB) Downloaded 321 times

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: New stack for SVG tracing / widget path creation

Post by bogs » Thu Aug 30, 2018 4:47 pm

Will try to test it out some more later today if i get the time :D
Image

ClipArtGuy
Posts: 253
Joined: Wed Aug 19, 2015 4:29 pm

Re: New stack for SVG tracing / widget path creation

Post by ClipArtGuy » Thu Aug 30, 2018 4:49 pm

bogs wrote:
Thu Aug 30, 2018 4:47 pm
Will try to test it out some more later today if i get the time :D
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

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: New stack for SVG tracing / widget path creation

Post by bogs » Thu Aug 30, 2018 5:07 pm

Working here now, very slick ClipArtGuy
Image Image
Image

ClipArtGuy
Posts: 253
Joined: Wed Aug 19, 2015 4:29 pm

Re: New stack for SVG tracing / widget path creation

Post by ClipArtGuy » Thu Aug 30, 2018 5:14 pm

bogs wrote:
Thu Aug 30, 2018 5:07 pm
Working here now, very slick ClipArtGuy
Image Image
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......

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: New stack for SVG tracing / widget path creation

Post by bogs » Thu Aug 30, 2018 6:35 pm

ClipArtGuy wrote:
Thu Aug 30, 2018 5:14 pm
I haven't had a mac since the 1990's, so I am unable to see if I can get it working there......
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.
for my own reference later wrote: Install Potrace on OSX
  1. Press Command+Space and type Terminal and press enter/return key.
  2. 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.
  3. 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.
  4. Run:
    brew install potrace
Image

ClipArtGuy
Posts: 253
Joined: Wed Aug 19, 2015 4:29 pm

Re: New stack for SVG tracing / widget path creation

Post by ClipArtGuy » Thu Aug 30, 2018 6:47 pm

bogs wrote:
Thu Aug 30, 2018 6:35 pm

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.

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.

ClipArtGuy
Posts: 253
Joined: Wed Aug 19, 2015 4:29 pm

Re: New stack for SVG tracing / widget path creation

Post by ClipArtGuy » Thu Aug 30, 2018 10:03 pm

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

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: New stack for SVG tracing / widget path creation

Post by bogs » Thu Aug 30, 2018 10:53 pm

ClipArtGuy wrote:
Thu Aug 30, 2018 6:47 pm
bogs wrote:
Thu Aug 30, 2018 6:35 pm
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.
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.
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 :shock: 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).
Image

Post Reply

Return to “Linux”