summaryrefslogtreecommitdiff
path: root/gerbonara/gerber/tests/image_support.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-01-09 23:37:27 +0100
committerjaseg <git@jaseg.de>2022-01-09 23:37:27 +0100
commit2ce0ff81ae50053022cc091b9db2d44f5b3ddc63 (patch)
treec1b4a444564c9799905aebb3556038a2ffe005c0 /gerbonara/gerber/tests/image_support.py
parent4d77937f01e4a7561f412a07e1e2c5a5dba0fc49 (diff)
downloadgerbonara-2ce0ff81ae50053022cc091b9db2d44f5b3ddc63.tar.gz
gerbonara-2ce0ff81ae50053022cc091b9db2d44f5b3ddc63.tar.bz2
gerbonara-2ce0ff81ae50053022cc091b9db2d44f5b3ddc63.zip
Fix remaining svg rendering/gerber compositing bugs
Diffstat (limited to 'gerbonara/gerber/tests/image_support.py')
-rw-r--r--gerbonara/gerber/tests/image_support.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gerbonara/gerber/tests/image_support.py b/gerbonara/gerber/tests/image_support.py
index ee84203..ba28561 100644
--- a/gerbonara/gerber/tests/image_support.py
+++ b/gerbonara/gerber/tests/image_support.py
@@ -63,13 +63,14 @@ def run_cargo_cmd(cmd, args, **kwargs):
def svg_to_png(in_svg, out_png, dpi=100, bg='black'):
run_cargo_cmd('resvg', ['--background', bg, '--dpi', str(dpi), in_svg, out_png], check=True, stdout=subprocess.DEVNULL)
-def gerbv_export(in_gbr, out_svg, format='svg', origin=(0, 0), size=(6, 6), fg='#ffffff'):
+def gerbv_export(in_gbr, out_svg, format='svg', origin=(0, 0), size=(6, 6), fg='#ffffff', bg='#000000'):
x, y = origin
w, h = size
cmd = ['gerbv', '-x', format,
'--border=0',
f'--origin={x:.6f}x{y:.6f}', f'--window_inch={w:.6f}x{h:.6f}',
f'--foreground={fg}',
+ f'--background={bg}',
'-o', str(out_svg), str(in_gbr)]
subprocess.run(cmd, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)