Requested by Krikor (I think).
This plug-in will loop through all your layers (named a.png, b.png ....ect),
Select Alpha to Selection each layer and converts to path and then export to svg files (named a.svg, b.svg...etc).
After running the plug-in, this was the screen that came up:
No selection to convert
Calling error for procedure 'gimp-image-remove-vectors':
Procedure 'gimp-image-remove-vectors' has been called with value '-1' for argument 'vectors' (#2, type GimpVectorsID). This value is out of range.
Win10 64 - Samj's Portable 2.10.21
"I feel that in both art and music, it's not the success that matters but the pleasure it gives you. Focus on the pleasure and the learning will come naturally." - Brian Weston
Error happens when layer is blank, there's no selection so it fails converting to path and so there's no path to export.
Please try version 2.0, where there is a check now to run only there is something to be selected on the layer otherwise it just skips it.
Well ... all the layers had a letter, except the space layer. I don't remember if the selected layer was the space layer or not, or even if the layer had visibility enabled.
I downloaded the new version, restarting Gimp.
This time it looked like everything was going well, but then ...
However, I noticed in the folder that before the plug-in stopped running, 36 .svg files were created
I think that some of the characters would have caused the interruption. The question mark maybe !? (?)
Traceback (most recent call last):
File "C:\Users\...\Gimp-2.10.21_Portable-32-64bit-Win\lib\gimp\2.0\python/gimpfu.py", line 741, in response
dialog.res = run_script(params)
File "C:\Users\...\Gimp-2.10.21_Portable-32-64bit-Win\lib\gimp\2.0\python/gimpfu.py", line 362, in run_script
return apply(function, params)
File "C:\Users\...\alpha-layers-to-svg.py", line 52, in python_tt_alpha_layers_to_svg
RuntimeError: Error opening file “C:\Users\...\TestPath03\?.svg”: Input/output error
Please give version 3.0 a try.
I have added code to try to catch error on exporting to svg. If it fails on filename such as ?.svg (on WIndows), it'll try to export it as a file named error_#.svg (where # will be replaced by error count, so if it fails 2 times, it'll export to error_1.svg and error_2.svg).
This way the plug-in still gets to finish and then you can look at your output directory to see what files are named that start with error_ and determine what you want to rename the file as some characters are invalid characters to name files with.
This time the plug-in has not stopped running.
• Created 75 .SVG files in the destination folder (\ TestPath02);
• Displayed an error for 06 characters (?,>, <, |,:, *);
• The total number of characters in this font is 110. (20 characters were not created or displayed as errors)
I am on Linux so I don't get illegal characters for filenames other the forward slash /.
On windows there are more characters that aren't allowed as filenames.
Try version 4.0. I have made it so It tries to run if it fails it error it'll output error_#.svg....
Yeah I tried the custom font file you mentioned and see no errors because I am on Linux, Linux is happy with all symbols/characters except for forward slash as expected.
Try version 4 on Windows, you should get bunch of errors but it'll still generate error_#.svg files.