Last active
November 18, 2022 00:01
-
-
Save ashleyconnor/ee6481430fc166e4fe8688e54b848c6b to your computer and use it in GitHub Desktop.
Creates a twitter sized image filling in the background with the dominate image color
This file contains 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
#!/bin/bash | |
export PATH=/usr/local/bin/:$PATH | |
for f in "$@" | |
do | |
hexcode=$(convert "$f" -format %c -depth 8 histogram:info:- | sort -n | tail -1 | awk '{ print $3 }') | |
convert "$f" -resize 1600x900 -background "$hexcode" -gravity center -extent 1600x900 "$f".twitter.png | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment