Composite images with a mask
Posted: 2013-07-10T09:17:00-07:00
Hello,
I'm trying to create a variation of the command that can composite an image over a background, through a mask, as described here:
http://www.imagemagick.org/Usage/compose/#mask
Instead of use two images saved on disc as the source images, I would like to create the source images in memory. I would like the
background to be a transparent canvas, and the foreground to be a solid canvas that shows through my mask (which is saved on disc
as 'mask.png'. This is what I have tried, but it generates a 'convert: missing an image filename' error:
convert -size 128x128 -alpha transparent canvas: \
-size 128x128 -background '#231F20' canvas: \
mask.png -composite output.png
Any help gratefully received.
I'm trying to create a variation of the command that can composite an image over a background, through a mask, as described here:
http://www.imagemagick.org/Usage/compose/#mask
Instead of use two images saved on disc as the source images, I would like to create the source images in memory. I would like the
background to be a transparent canvas, and the foreground to be a solid canvas that shows through my mask (which is saved on disc
as 'mask.png'. This is what I have tried, but it generates a 'convert: missing an image filename' error:
convert -size 128x128 -alpha transparent canvas: \
-size 128x128 -background '#231F20' canvas: \
mask.png -composite output.png
Any help gratefully received.