Created
June 7, 2012 17:00
-
-
Save KhasMek/2890061 to your computer and use it in GitHub Desktop.
simple script to find and colorize file in a folder(s) (rainbow edition)
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 | |
# | |
# A simple colorizer script for ImageMagick to batch modify | |
# resource images. | |
# -KhasMek | |
file=${1} | |
location=${2} | |
if [ ! "$location" ]; then | |
location=. | |
fi | |
if [ ! "$file" ]; then | |
file=*.png | |
fi | |
find $location -name $file | while read line | |
do | |
# I don't think this will actually be necessary. | |
#if [ find $line -name *.9.png ! = "" ]; then | |
# echo "$line is a 9 png, cropping" | |
# convert $line -crop 1x1+1+1 +repage $line | |
#fi | |
hue=$[ ( $RANDOM % 300 ) + 1 ] | |
echo "colorizing $line to hue $hue" | |
# Brightness, Saturation, Hue. | |
convert $line -modulate 100,10,$hue $line | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment