Created
February 26, 2024 04:44
-
-
Save AnonymerNiklasistanonym/361aa972926e87546767477d17a72efe to your computer and use it in GitHub Desktop.
Horizontally flip png images and overlay an png image on top of them, then convert the png images to an animated webp image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Horizontally flip png images and overlay an png image on top of them | |
for filename in frame_*.png | |
do | |
echo "Update $filename" | |
# Horizontal flip | |
magick "$filename" -flop "$filename" | |
# Add overlay image | |
magick convert "$filename" "../overlay.webp" -gravity Center -composite "$filename" | |
done | |
# Convert png images to an animated webp image | |
FILES=$(echo frame_*.png | sort) | |
echo "Merge $FILES" | |
magick $FILES -quality 50 -define webp:lossless=true animation.webp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment