bin/transparent: initial version
This commit is contained in:
parent
48f21cd4a0
commit
bee07eedbd
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh -ex
|
||||
# Turn white (or another color) into transparent for the given images
|
||||
# TODO https://safe.duckduckgo.com/?q=imagemagick+color+to+alpha&ia=web https://stackoverflow.com/questions/26408022/imagemagick-color-to-alpha-like-the-gimp/27194202#27194202
|
||||
case $1 in (-*) color=${1#-};; esac
|
||||
for arg
|
||||
do extension="-transparent.${arg##*.}"
|
||||
case $extension in (*jp*g) extension=".png";; esac
|
||||
convert "$arg" -transparent ${color:-white} -fuzz 60% "$arg$extension"
|
||||
done
|
Loading…
Reference in New Issue