-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexp-svgCircles-AUX-render.sh
56 lines (53 loc) · 4.16 KB
/
exp-svgCircles-AUX-render.sh
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
#!/bin/bash
# -*- Mode:Shell-script; Coding:us-ascii-unix; fill-column:158 -*-
################################################################################################################################################################
##
# @file exp-svgCircles-AUX-render.sh
# @author Mitch Richling <https://www.mitchr.me>
# @brief Render svg files generated by exp-svgCircles.lisp into annotated png files.@EOL
# @keywords svg convert rsvg librsvg
# @std sh bash
# @copyright
# @parblock
# Copyright (c) 2019, Mitchell Jay Richling <https://www.mitchr.me> All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# @endparblock
################################################################################################################################################################
#---------------------------------------------------------------------------------------------------------------------------------------------------------------
USE_RSVG='Y'
#---------------------------------------------------------------------------------------------------------------------------------------------------------------
declare -A FILES
FILES[exp-svgCircles-OUT-frog]='The Frog By: Mitch Richling (2019)'
FILES[exp-svgCircles-OUT-gateway]='The Gateway By: Mitch Richling (2019)'
FILES[exp-svgCircles-OUT-flower]='Flower By: Mitch Richling (2019)'
FILES[exp-svgCircles-OUT-skinnyfrog]='Skinny Frog By: Mitch Richling (2019)'
FILES[exp-svgCircles-OUT-victorianbulb]='Victorian Bulb By: Mitch Richling (2019)'
FILES[exp-svgCircles-OUT-craneknot]='A Knot Of Cranes By: Mitch Richling (2019)'
FILES[exp-svgCircles-OUT-flight]='Flight By: Mitch Richling (2019)'
FILES[exp-svgCircles-OUT-turbulence]='Turbulence By: Mitch Richling (2019)'
#---------------------------------------------------------------------------------------------------------------------------------------------------------------
for f in "${!FILES[@]}"; do
echo '============================================='
echo $f
if [ "$USE_RSVG" = "Y" ] ; then
rsvg-convert --dpi-x=600 --dpi-y=600 --height=800 --keep-aspect-ratio --unlimited --background-color=white --format=png --output=$f.png $f.svg
else
convert -density 600 -resize 800 -background white -flatten $f.svg $f.png
fi
convert $f.png -gravity South -background Khaki -splice 0x18 -annotate +0+2 "${FILES[$f]}" ${f}A.png
done