Skip to content

Instantly share code, notes, and snippets.

@omundy
Created June 14, 2020 15:34
Show Gist options
  • Save omundy/a25ea3e80d1bbd07e7e5d0326f0a5158 to your computer and use it in GitHub Desktop.
Save omundy/a25ea3e80d1bbd07e7e5d0326f0a5158 to your computer and use it in GitHub Desktop.
#!/bin/bash
## Convert non-transparent pixels in a PNG image to a solid color "silhouette"
## Uses imagemagick
# install imagemagick
brew update && brew install imagemagick
# convert input.png to silhouette
convert input.png -fill "cyan" -colorize 100 output.png
# convert *all* PNG files in current directory, overwriting existing files
find ./ -iname '*.png' -exec convert "{}" -fill "#990000" -colorize 100 "{}" \;
# convert *all* PNG files in current directory, save new file in output-files
mogrify -format png -path ../output-files/ -fill "#754bc3" -colorize 100 *.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment