Last active
October 28, 2017 00:06
-
-
Save comm1x/0dd1279d73013ab25233212dace9e6bc to your computer and use it in GitHub Desktop.
Imagemagick script for tinting images. Replace all color with given.
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 | |
if [ $# -le 2 ]; then | |
echo 'convert-tint - script for tinting images, replace any color with given.' | |
echo 'Usage: convert-tint source.jpg "#FF0000" target.jpg' | |
exit 0 | |
fi | |
source=$1 | |
color=$2 | |
target=$3 | |
# Final command | |
# convert source.jpg -fuzz 99.9% -fill "#FF0000" -opaque black out.png | |
convert ${source} -fuzz 99.9% -fill ${color} -opaque black ${target} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment