Skip to content

Instantly share code, notes, and snippets.

@comm1x
Last active October 28, 2017 00:06
Show Gist options
  • Save comm1x/0dd1279d73013ab25233212dace9e6bc to your computer and use it in GitHub Desktop.
Save comm1x/0dd1279d73013ab25233212dace9e6bc to your computer and use it in GitHub Desktop.
Imagemagick script for tinting images. Replace all color with given.
#!/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