http://tech.natemurray.com/2007/12/convert-white-to-transparent.html cd images/im/masking # doesnt work convert -fuzz .2% -transparent white tool.png ugly_fuzz.png composite -compose Dst_Over -tile pattern:checkerboard ugly_fuzz.png ugly_fuzz_check.png # doesnt work convert -fuzz 10% -transparent white tool.png removed_too_much.png composite -compose Dst_Over -tile pattern:checkerboard removed_too_much.png removed_too_much_check.png # works okay convert tool.png -bordercolor white -border 1x1 -matte -fill none -fuzz 7% -draw 'matte 1,1 floodfill' -shave 1x1 white_floodfill.png composite -compose Dst_Over -tile pattern:checkerboard white_floodfill.png white_floodfill_check.png # start real convert tool.png \( +clone -fx 'p{0,0}' \) -compose Difference -composite -modulate 100,0 +matte difference.png # remove the black, replace with transparency convert difference.png -bordercolor white -border 1x1 -matte -fill none -fuzz 7% -draw 'matte 1,1 floodfill' -shave 1x1 removed_black.png composite -compose Dst_Over -tile pattern:checkerboard removed_black.png removed_black_check.png # create the matte convert removed_black.png -channel matte -separate +matte matte.png # negate the colors convert matte.png -negate -blur 0x1 matte-negated.png # you are going for: white interior, black exterior composite -compose CopyOpacity matte-negated.png tool.png finished.png composite -compose Dst_Over -tile pattern:checkerboard finished.png finished_check.png