From 5640c426624eea37767836556a563f6d505e6932 Mon Sep 17 00:00:00 2001 From: mmattmcw Date: Fri, 10 Sep 2021 00:36:46 -0400 Subject: [PATCH 1/2] rename image_seq to seq --- image_seq.sh => seq.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) rename image_seq.sh => seq.sh (59%) diff --git a/image_seq.sh b/seq.sh similarity index 59% rename from image_seq.sh rename to seq.sh index abbebd4..6c577e8 100644 --- a/image_seq.sh +++ b/seq.sh @@ -11,14 +11,13 @@ WIDTH=323 HEIGHT=242 if [[ "${INVERT}" != "" ]]; then - INVERT="-vf negate" + INVERT="negate," fi mkdir -p "${OUTPUT}" -ffmpeg -re -i "${INPUT}" \ +ffmpeg -y -re -i "${INPUT}" \ -f image2 \ -r ${RATE} \ - "${INVERT}" \ - -vf crop=in_h/3*4:in_h,scale=$WIDTH:$HEIGHT,setsar=1:1 \ + -vf ${INVERT}crop=in_h/3*4:in_h,scale=$WIDTH:$HEIGHT,setsar=1:1 \ "${OUTPUT}/image_%06d.png" \ No newline at end of file From e6382f17470108707edbc39d875da8d9f98aab98 Mon Sep 17 00:00:00 2001 From: mmattmcw Date: Fri, 10 Sep 2021 00:37:08 -0400 Subject: [PATCH 2/2] Run stipple without display --- stipple.sh | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/stipple.sh b/stipple.sh index afa4599..77c6374 100644 --- a/stipple.sh +++ b/stipple.sh @@ -1,24 +1,33 @@ #!/bin/bash +if [[ "${1}" == "" ]]; then + echo "Please provide a directory of images as the first argument" + exit 1 +fi + INPUT=`realpath "${1}"` OUTPUT=`realpath "${2}"` INVERT="${3}" -if [[ "${INVERT}" == "" ]]; then - INVERT="false" -else - INVERT="true" +if [ ! -d "${INPUT}" ]; then + echo "Directory ${1} doesn't exist" + exit 2 fi +mkdir -p "${OUTPUT}" + + + WIDTH=404 HEIGHT=374 DOTSIZE=4 MAXGENERATIONS=25 -MAXPARTICLES=500 +MAXPARTICLES=400 MINDOTSIZE=0.8 LINE=0.8 FILL=true MODE="stipple" +INVERT="false" IMAGES="" @@ -36,6 +45,7 @@ for png in "${INPUT}/"*.png ; do VIDEO="${OUTPUT}/${part}.mov" fi bash stipple_gen.sh \ + --display "false" \ --inputImage "${tmp}" \ --outputImage "${OUTPUT}/${name}_rendered.png" \ --outputSVG "${OUTPUT}/${name}.svg" \ @@ -51,6 +61,11 @@ for png in "${INPUT}/"*.png ; do --maxParticles $MAXPARTICLES \ --mode $MODE \ --invert $INVERT + + if [[ "${INVERT}" != "" ]]; then + convert "${OUTPUT}/${name}_rendered.png" -channel RGB -negate "${OUTPUT}/${name}_rendered.png" + fi + rm "${tmp}" cd ~/src/animation/ if [ "${MODE}" != "tsp" ]; then @@ -60,6 +75,6 @@ for png in "${INPUT}/"*.png ; do fi done -ffmpeg -r 12 -f image2 -i "${IMAGES}" \ +ffmpeg -y -r 12 -f image2 -i "${IMAGES}" \ -c:v prores_ks -profile:v 3 \ "${VIDEO}"