From: Hugo Villeneuve Date: Thu, 5 Oct 2023 14:18:57 +0000 (-0400) Subject: No intermediate conversions X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=804a17f5e596fdd4aa6ec662bdbb930f2be4f933;p=fgen.git No intermediate conversions --- diff --git a/fgen.sh b/fgen.sh index b3b1d26..019e662 100755 --- a/fgen.sh +++ b/fgen.sh @@ -157,10 +157,8 @@ log_dbg "CANVAS SIZE=${size}" rm -f ${dest}/frame*.png -# Extract global frame: -convert ${IM_OPS} ${src}[1] ${dest}/psd0.png - -cp ${dest}/psd0.png ${dest}/temp.png +# Create background frame: +convert -size ${size} xc:none ${dest}/background.png # Remove first line (Layer 558): ${SED} -i -e '1d' ${layers} @@ -168,6 +166,8 @@ ${SED} -i -e '1d' ${layers} # Will start at frame 2 at first loop iteration f=1 +files="" + while read l; do f=$((${f} + 1)) @@ -184,22 +184,17 @@ while read l; do continue fi - convert ${IM_OPS} ${src}[${f}] ${dest}/psd${f}.png - - composite ${IM_OPS} -geometry ${p} ${dest}/psd${f}.png ${dest}/temp.png ${dest}/temp.png + files="${files} -page ${p} ${src}[${f}]" -if [ x"${nf}" != x"" ]; then + if [ x"${nf}" != x"" ]; then log_dbg "New frame ID: ${nf}" - cp ${dest}/temp.png ${dest}/f${nf}.png - cp ${dest}/psd0.png ${dest}/temp.png + convert -page +0+0 ${dest}/background.png ${files} -background none -layers merge ${dest}/f${nf}.png + files="" fi + done <${layers} if which ffmpeg 1> /dev/null 2>&1; then # Conversion vidéo: ffmpeg -y -r ${fps} -start_number 1 -i ${dest}/f%d.png ${dest}/sequence.mp4 fi - -rm -f ${dest}/temp.png - -#rm -f ${dest}/psd*.png