Question

Given a RGB image :

enter image description here

Given a grey scale, opacity 0% to opacity 100% black image:

enter image description here

How to add the alpha shadows upon the RGB image using a shell command ? (preferemce for ImageMagick Convert)

Was it helpful?

Solution

I would compose the images using the Multiply operator. The command

convert src.png overlay.png -compose Multiply -geometry 948x630 -composite out.png

produces:

enter image description here

OTHER TIPS

I believe the example "Using Masks with Images" covers this. Simply disable the alpha channel, and copy over the second image as opacity composite. Add -negate option to invert the 0% ~ 100% opacity -- if needed.

 convert map_image.png elevation_mask.png \
         -alpha Off -compose CopyOpacity -composite \
         out.png

alpha mask

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top