static-captcha/merge.sh

17 lines
353 B
Bash
Raw Normal View History

2025-01-03 17:18:41 +00:00
#!/bin/bash
# Split the frames out
mkdir frames
ffmpeg -i $1 frames/frame%04d.png
# Change the white -> transparent
mkdir chromakeyed
for f in frames/*
do
convert $f -fuzz 50% -transparent white chromakeyed/$(basename $f)
done
# Merge all the frames into one image
convert chromakeyed/* -background red -flatten flat.png
rm -r frames chromakeyed