Seems to work fine now, added some more sample images

This commit is contained in:
2019-06-04 16:41:58 -07:00
parent aa8a92870c
commit dc85e7a58c
8 changed files with 70 additions and 51 deletions

View File

@@ -7,6 +7,8 @@ class ImageConverter:
# mkbitmap settings
self.highpass_filter = 0
self.blur = 0
# potrace settings
self.turd = 0
# This function takes a file and runs it through mogrify, mkbitmap, and finally potrace.
# The flow of the intermediate files is
@@ -39,12 +41,17 @@ class ImageConverter:
print("Running potrace...")
start = time.time()
subprocess.call(["potrace",
# "-t", "0.1",
potrace_args = ["potrace",
"-z", "white",
"-b", "svg",
"input-images/{}-n.pbm".format(base_name),
"--rotate", "0",
"-o", "tmp/conversion-output.svg",
])
"-o", "tmp/conversion-output.svg"]
if settings.turd > 0:
potrace_args.append(["-t", settings.turd])
subprocess.call(potrace_args)
print("Run took [{:.2f}] seconds\n".format(time.time() - start))