Compare commits

..

5 Commits

5 changed files with 63 additions and 5 deletions

4
.gitignore vendored
View File

@ -1 +1,5 @@
*.DS_Store *.DS_Store
*.png
*.webm
*.mkv
test_svg

15
image_seq.sh Normal file
View File

@ -0,0 +1,15 @@
#!/bin/bash
INPUT="${1}"
OUTPUT="${2}"
WIDTH=323
HEIGHT=242
mkdir -p "${OUTPUT}"
ffmpeg -re -i "${INPUT}" \
-f image2 \
-r 12 \
-vf crop=in_h/3*4:in_h,scale=$WIDTH:$HEIGHT,setsar=1:1 \
"${OUTPUT}/image_%06d.png"

View File

@ -17,13 +17,13 @@ for svg in "${1}"*.svg ; do
name=`echo "${filename}" | cut -d'.' -f1` name=`echo "${filename}" | cut -d'.' -f1`
num=`echo "${name}" | awk -F'_' '{print $(NF)}'` num=`echo "${name}" | awk -F'_' '{print $(NF)}'`
echo "Drawing $svg file..." echo "Drawing $svg file..."
#bash position.sh set bash position.sh set
#ax guides/guide_marks.svg ax guides/guide_marks.svg
number=`mktemp`.svg number=`mktemp`.svg
node ./numbers/ -n "${num}" -o "${number}" node ./numbers/ -n "${num}" -o "${number}"
#ax "${number}" ax "${number}"
rm -f "${number}" rm -f "${number}"
#bash position.sh reset bash position.sh reset
echo "Are you ready to continue? (yes/no)" echo "Are you ready to continue? (yes/no)"
read input read input
if [ "$input" != "n" ] && [ "$input" != "no" ] if [ "$input" != "n" ] && [ "$input" != "no" ]

39
stipple.sh Normal file
View File

@ -0,0 +1,39 @@
#!/bin/bash
INPUT=`realpath "${1}"`
OUTPUT=`realpath "${2}"`
WIDTH=404
HEIGHT=374
DOTSIZE=4
MAXGENERATIONS=25
MAXPARTICLES=500
MINDOTSIZE=0.8
LINE=0.8
FILL=true
#files in dir
for png in "${INPUT}/"*.png ; do
filename=`basename "${png}"`
name=`echo "${filename}" | cut -d'.' -f1`
num=`echo "${name}" | awk -F'_' '{print $(NF)}'`
tmp=`mktemp`.png
bash white.sh "${png}" "${tmp}"
cd ~/src/stipple_gen/
bash stipple_gen.sh \
--inputImage "${tmp}" \
--outputImage "${OUTPUT}/${name}_rendered.png" \
--outputSVG "${OUTPUT}/${name}.svg" \
--canvasWidth $WIDTH \
--canvasHeight $HEIGHT \
--dotSizeFactor $DOTSIZE \
--windowWidth $WIDTH \
--windowHeight $HEIGHT \
--maxGenerations $MAXGENERATIONS \
--minDotSize $MINDOTSIZE \
--line $LINE \
--fill $FILL \
--maxParticles $MAXPARTICLES
rm "${tmp}"
cd ~/src/animation/
done

View File

@ -11,7 +11,7 @@ HEIGHT=374
#convert image.jpg -background white -gravity center -extent 800x800 output.jpg #convert image.jpg -background white -gravity center -extent 800x800 output.jpg
convert -size ${WIDTH}x${HEIGHT} xc:#FFFFFF white.png convert -size ${WIDTH}x${HEIGHT} xc:#FFFFFF white.png
composite -gravity Center white.png "${1}" "${2}" composite -gravity Center "${1}" white.png "${2}"
rm white.png rm white.png
echo "Centered in white ${1} -> ${2}" echo "Centered in white ${1} -> ${2}"