Created
June 15, 2017 08:56
-
-
Save lolgear/66d1d5744e566e6bc0fa721a9ed54c11 to your computer and use it in GitHub Desktop.
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
ls Resources/*.png | perl -lne '$old = $_; s/(\@\w+)/_inverted$1/; $_ = qx(basename $_); chomp; $_ = qq(Results/$_); $s = qq(convert $old -fuzz 10% -fill none +opaque white $_); print $s; print qx($s);' | |
# 1. details: | |
# 2. take png images from directory Resources | |
# 3. append "_inverted" before \@ symbol. | |
# 4. convert $old -fuzz 10% -fill none +opaque white $new | |
# 5. -fuzz add threshold in 10% for white color. Which are NOT white in 10% thresholds would be removed. | |
# 6. -fill none should fill color with transparent color | |
# 7. +opaque matches color to be replaced. plus add inversion. So, +opaque matches these colors that SHOULD NOT be replaced. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment