From 5a1015a05c07c9f13ab2f1bde1d1de5b73f15f94 Mon Sep 17 00:00:00 2001 From: Patrick Fairbank Date: Sun, 23 Sep 2018 10:55:45 -0700 Subject: [PATCH] Add script to fix avatar colors for overlay. --- fix_avatar_colors_for_overlay | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 fix_avatar_colors_for_overlay diff --git a/fix_avatar_colors_for_overlay b/fix_avatar_colors_for_overlay new file mode 100755 index 0000000..d0bed77 --- /dev/null +++ b/fix_avatar_colors_for_overlay @@ -0,0 +1,17 @@ +# This script replaces a single color in the team avatars with a second one, to fix conflicts with chroma/luma key. +# By default, it replaces black with dark gray; edit the two variables below to change this. +# Run it after the team list import, during which the avatars are downloaded. + +COLOR_TO_REPLACE="#000" +REPLACEMENT_COLOR="#222" + +echo "This script will replace color $COLOR_TO_REPLACE with $REPLACEMENT_COLOR in the following files:\n" +cd ./static/img/avatars +ls *.png +echo "\nPress enter to continue or CTRL-C to cancel." +read + +for f in *.png +do + convert $f -fill $REPLACEMENT_COLOR -fuzz 10% -opaque $COLOR_TO_REPLACE $f +done