Skip to content

Instantly share code, notes, and snippets.

@ls0f
Last active October 16, 2015 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ls0f/35e168f7a78d02dad3fa to your computer and use it in GitHub Desktop.
Save ls0f/35e168f7a78d02dad3fa to your computer and use it in GitHub Desktop.
image magick remove backgroud and set the backgroud transparent
#!/bin/bash
convert $1 -channel A -blur 1x65000 -level 50x100% \
-channel rgba $2
#!/bin/bash
convert $1 -fuzz 5% \
-fill none -draw "matte 0,0 floodfill" \
-flop -draw "matte 0,0 floodfill" \
-flip -draw "matte 0,0 floodfill" \
-flop -draw "matte 0,0 floodfill" \
-flip -quality 100% $2
#!/bin/bash
convert $1 -fuzz 5% -trim $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment