CONTOUR

 Applies a contour outline to the image content.

EXAMPLES

 Example 1 - Extract Mask By Floodfill Of White Background Original Image Arguments: -a 0 Arguments: -h off -a 0 Arguments: -o pink -a 0

 Example 2 - Extract Mask From Alpha Channel Original Image (source) Arguments: -a 0 Arguments: -o pink -a 0

 Example 3 - Mask Image Provided Original Image (source) Mask Image (source) Arguments: -a 0

 Example 4 - Extract Mask By Floodfill Black Background Original Image (source) Arguments: -i black -a 0

 Example 5 - Extract Mask By Floodfill White Background Original Image Arguments: -d 35 -a 0 Arguments: -d 10 -r 3 -a 0 Arguments: -d 40 -e 30 -r 3 -a 0 Arguments: -d 20 -r 0 -h off -a 2500

 Example 6 - Extract Mask By Floodfill White Background Original Image Arguments: -d 35 -f 20 -a 0

 What the script does for m=morphology is as follows: Reads the input Extracts a mask either from the alpha channel, a separately provided mask, or by floodfill/recoloring Copies the mask and makes and edge image Dilates, inverts and blurs the mask to add the shadow Composites the images together Writes the output This is equivalent to the following IM commands when the image has no alpha channel or no mask. convert \ \( "\$infile" -bordercolor "\$icolor" -border 1 \ -alpha off -fuzz \$fuzzval% -fill none \ -draw "matte \$coords floodfill" \ -fuzz \$tolerance -trim +repage \ -bordercolor none -border 50 \ -background white -alpha background \ -alpha off -write mpr:img -alpha on \ -alpha extract -morphology dilate disk:\$distance \ -blur 0x1 -level 0x50% -write mpr:msk1 +delete \) \ \( mpr:msk1 -negate -fill "gray(\$shadow%)" -opaque black \ -fill "\$ocolor" -opaque white \ -blur 0x\$ramping -write mpr:msk2 +delete \) \ \( mpr:msk1 -morphology edgein diamond:1 -negate -write mpr:edg +delete \) \ mpr:img mpr:msk1 -alpha off -compose copy_opacity -composite \ mpr:msk2 -reverse -compose over -composite \ mpr:edg -compose multiply -composite \ "\$outfile"