Stipple script allows for different modes and renders a video

This commit is contained in:
Matt McWilliams 2021-08-12 00:52:37 -04:00
parent 711ad36b02
commit b4b8fd37cb
1 changed files with 18 additions and 4 deletions

View File

@ -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}"