PNGtoSVG
Converter class to convert character PNGs to BMPs and SVGs.
Source code in handwrite/pngtosvg.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
bmpToSvg(path)
¶
Convert .bmp image to .svg using potrace.
Converts the passed .bmp file to .svg using the potrace (http://potrace.sourceforge.net/). Each .bmp is passed as a parameter to potrace which is called as a subprocess.
Parameters¶
path : str Path to the bmp file to be converted.
Raises¶
PotraceNotFound Raised if potrace not found in path by shutil.which()
Source code in handwrite/pngtosvg.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
convert(directory)
¶
Call converters on each .png in the provider directory.
Walk through the custom directory containing all .png files from sheettopng and convert them to png -> bmp -> svg.
Source code in handwrite/pngtosvg.py
14 15 16 17 18 19 20 21 22 23 24 25 26 | |
pngToBmp(path)
¶
Convert .bmp image to .svg using potrace.
Converts the passed .bmp file to .svg using the potrace (http://potrace.sourceforge.net/). Each .bmp is passed as a parameter to potrace which is called as a subprocess.
Parameters¶
path : str Path to the bmp file to be converted.
Raises¶
PotraceNotFound Raised if potrace not found in path by shutil.which()
Source code in handwrite/pngtosvg.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |