-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSnakefile
59 lines (49 loc) · 1.24 KB
/
Snakefile
1
2
3
4
5
6
7
8
9
10
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
logos = [
"bioferris",
"bioferris_padded",
"bioferris_thin_strand",
"bioferris_thick_strand",
"bioferris_light_strand",
"bioferris_curly_back",
"bioferris_curly_front",
]
resolutions = [
32,
128,
256,
512,
"full",
]
rule all:
input:
"png/overview.png"
rule export_png:
input:
"svg/{logo}.svg"
output:
"png/{logo}_{resolution}.png"
params:
resolution=lambda w: "" if w.resolution == "full" else f"export-width:{w.resolution};"
shell:
# Tested with inkscape 1.0 installed on ubunto 20.04 via snap
"inkscape --export-filename {output} --export-type png --actions='{params.resolution}export-do;' {input}"
rule assemble_line:
input:
expand(
"png/{{logo}}_{resolution}.png",
resolution=[res for res in resolutions if res != "full"],
),
output:
"png/row_{logo}_all.png"
shell:
"convert -background transparent {input} +append {output}"
rule assemble_overview:
input:
expand(
"png/row_{logo}_all.png",
logo=logos,
),
output:
"png/overview.png",
shell:
"convert -background transparent {input} -append {output}"