Interlaced effect on image with alpha using ffmpeg and some image editor like gimp
9. 8. 2019In Gimp save first frame as bronto_001.png, reposition the logo and save as bronto_002.png.
Then, using ffmpeg
ffmpeg -i bronto_%03d.png -filter:v interlace bronto_interlaced.png
or, sharper
ffmpeg -i bronto_%03d.png -filter:v interlace=scan=1:lowpass=2 bronto_interlaced2.png
and with scale
ffmpeg -i bronto_%03d.png -filter:v scale=900:-1,interlace=scan=1:lowpass=2 bronto_interlaced_logo.png
Voila.
p.s. Css to embed this 1:1 ^
style="object-position: 0 0; object-fit: none; width:1313px; height:568px;"
p.s.2. The not-working-as-expected imagemagick way to interlace.
p.s.3. With imagemagick the gimp repositioning part could be simply done by adding transparent TL pixels on one and BR pixels on 2nd ‘field’. https://www.imagemagick.org/Usage/crop/#extent
Script ↓
#!/bin/bash
# InterlaceMagick (using imagemagick and ffmpeg)
# input should be transparent image
# usage: interlaceMagick logo.png 0.5
# ^ percents of height-based offset
set -ex
# input
logo="$1"
offset="$2"
[[ -z "$offset" ]] && offset="2"
# input breakdown
file=$(readlink -f "$logo") # quasi absolute
baseext=$(basename "${logo}") # file.ext
base="${baseext%.*}" # file
#ext="${file##*.}" # ext
dir=${file%/*} # directory
# tmp dir http://mywiki.wooledge.org/BashFAQ/062
tmp="/tmp/$RANDOM-$$"
trap '[ -n "$tmp" ] && rm -fr "$tmp"' EXIT
mkdir -m 700 "$tmp" || { echo '!! unable to create a tmpdir' >&2; tmp=; exit 1; }
# get logo height in px
height="$(convert "$1" -format "%h" info:)"
echo "$height px"
# now get N% of that height in px
n="$(convert xc: -format "%[fx:$height*$offset/100]" info:)"
echo "$n"
# field 1
convert "$file" -background transparent -splice "${n}"x"${n}" "$tmp/field_001.png"
# field 2
convert "$file" -background transparent -gravity southeast -splice "${n}"x"${n}" "$tmp/field_002.png"
# interlace
ffmpeg -i "$tmp/field_%03d.png" -filter:v interlace=scan=1:lowpass=2 -y "$dir/${base}_interlaced.png"
3 pass degradation + some gimp video fx