Page 1 of 1

Mask create grey image

Posted: 2019-09-29T11:08:02-07:00
by Marcel71
Hi,

When I do the following command, my original image turns gray and it leaves a small gray border around the heart. Anybody know how to make a different command so it will work?

Code: Select all

magick heart.png -resize 296x261! -channel RGBA -blur 0x0 -draw "image Out -135,-6 584,443 'kitty.png' " -trim +repage out.png
heart.png:
Image

kitty.png
Image

result:
Image

My IM Version:
Version: ImageMagick 7.0.8-66 Q16 x86_64 2019-09-29 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib

Thanks,
Marcel

Re: Mask create grey image

Posted: 2019-09-29T11:43:57-07:00
by fmw42
You can do that as follows by anti-aliasing the mask with some blurring. This is Unix syntax. You did not identify your platform.

Code: Select all

convert kitty.png \
\( heart.png -alpha extract -negate -blur 0x1 -level 50x100% \) \
-alpha off -gravity center -compose copy_opacity -composite \
kitty_masked.png
Increase the blur 0x2 if you need more smoothing.