From b4b8fd37cb0c7e91ad039be420d46fa0ffe3892a Mon Sep 17 00:00:00 2001 From: mmattmcw Date: Thu, 12 Aug 2021 00:52:37 -0400 Subject: [PATCH] Stipple script allows for different modes and renders a video --- stipple.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/stipple.sh b/stipple.sh index 9a0cd9c..57138bd 100644 --- a/stipple.sh +++ b/stipple.sh @@ -11,6 +11,9 @@ MAXPARTICLES=500 MINDOTSIZE=0.8 LINE=0.8 FILL=true +MODE="stipple" + +IMAGES="" #files in dir for png in "${INPUT}/"*.png ; do @@ -20,6 +23,11 @@ for png in "${INPUT}/"*.png ; do tmp=`mktemp`.png bash white.sh "${png}" "${tmp}" cd ~/src/stipple_gen/ + if [ "${IMAGES}" == "" ]; then + part=`echo "${name}" | awk -F'_0' '{print $1}'` + IMAGES="${OUTPUT}/${part}_%06d_rendered.png" + VIDEO="${OUTPUT}/${part}.mov" + fi bash stipple_gen.sh \ --inputImage "${tmp}" \ --outputImage "${OUTPUT}/${name}_rendered.png" \ @@ -33,11 +41,17 @@ for png in "${INPUT}/"*.png ; do --minDotSize $MINDOTSIZE \ --line $LINE \ --fill $FILL \ - --maxParticles $MAXPARTICLES + --maxParticles $MAXPARTICLES \ + --mode $MODE rm "${tmp}" cd ~/src/animation/ - opt=`mktemp`.svg - svgsort "${OUTPUT}/${name}.svg" "${opt}" - mv "${opt}" "${OUTPUT}/${name}.svg" + if [ "${MODE}" != "tsp" ]; then + opt=`mktemp`.svg + svgsort "${OUTPUT}/${name}.svg" "${opt}" + mv "${opt}" "${OUTPUT}/${name}.svg" + fi done +ffmpeg -r 12 -f image2 -i "${IMAGES}" \ + -c:v prores_ks -profile:v 3 \ + "${VIDEO}"