Page 1 of 1
How to composite image with a mask
Posted: 2019-01-29T23:24:04-07:00
by tczf1128
mask image:
base image:
I want to make the base image into a circle with this mask image
version: IM-7
Re: How to composite image with a mask
Posted: 2019-01-30T00:22:05-07:00
by fmw42
You did not say which OS you are using nor the exact IM version. Assuming Unix (Linux or Mac OSX), try either
Code: Select all
magick base.jpg -set option:dims "%wx%h" \( mask.png -alpha extract -resize 200% -size "%[dims]" xc:white +swap -gravity center -geometry -20-20 -alpha off -compose copy_opacity -composite \) +geometry -compose over -composite result1.png
magick base.jpg -set option:dims "%wx%h" \( mask.png -alpha extract -resize 200% -size "%[dims]" xc:white +swap -gravity center -geometry -20-20 -alpha off -compose copy_opacity -composite \) +geometry -compose over -composite -trim +repage result2.png
For Windows, remove all the \
Re: How to composite image with a mask
Posted: 2019-01-31T00:58:01-07:00
by tczf1128
thanks!