Skip to content

Instantly share code, notes, and snippets.

@lincerely
Last active April 25, 2022 17:19
Show Gist options
  • Save lincerely/fef57ebf16e396dc3ab0db087d7520b2 to your computer and use it in GitHub Desktop.
Save lincerely/fef57ebf16e396dc3ab0db087d7520b2 to your computer and use it in GitHub Desktop.
[imagemagick] get clear color from top left corner and set it to transparent
#!/bin/sh
#
if [ $# -ne 2 ]; then
echo usage: clear_color.sh IN_FILE OUT_FILE
exit 1
fi
convert "$1" -transparent "#"`magick "$1" -format "%[hex:p{0,0}]" info:` "$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment