Page 1 of 1

Move Masked composition around over larger canvas

Posted: 2018-11-17T04:40:29-07:00
by kimmyk
Hi,

Been reading and trying to find a solution, but I can't find it.

I have 4 images:
1. profile image
2. mask
3. image to overlay over the masked profile image (like a wrapped plastic png)
4. the background image
"/usr/bin/magick \( ". $profile_pic ." -resize 300 \
". $mask ." -compose CopyOpacity -composite \
". $mask_overlay ." -compose Over -alpha set -background none -rotate -5 \) -composite \
\( ". $input ." -resize 600 \) +swap -compose Over -composite \
" . $output;
This code makes it look great (finally;-)), but, the mask is in the upper left corner of the image. I'd like to be able to move it around freely.
Is there no such easy way?

I have read this as well:
https://www.imagemagick.org/Usage/compose/
"Unfortunately while "-gravity" and "-geometry" settings will let you re-position the source image, the mask image is NOT re-positioned, and remains aligned with the destination image."

This is a solution given, but I don't know how to implement it in my code, my attempts failed:
convert tile_aqua.jpg tile_water.jpg \
\( -background black -splice 10x25+0+0 moon_mask.gif \) \
-composite mask_offset.jpg

I have tried various versions of moving my Grouped masking around but that produced off-set results

Anybody?

Re: Move Masked composition around over larger canvas

Posted: 2018-11-17T05:15:23-07:00
by snibgo
You have a profile_pic that you make partially transparent with a mask, and composite over that with a mask_overlay. That gives an image that you want to compose somewhere over the input, correct?

Then insert "-geometry +40+50" or whatever immediately before "+swap".

If that doesn't do what you want, please link to sample files of the four images.

Re: Move Masked composition around over larger canvas

Posted: 2018-11-17T06:09:26-07:00
by kimmyk
snibgo wrote: 2018-11-17T05:15:23-07:00 You have a profile_pic that you make partially transparent with a mask, and composite over that with a mask_overlay. That gives an image that you want to compose somewhere over the input, correct?

Then insert "-geometry +40+50" or whatever immediately before "+swap".

If that doesn't do what you want, please link to sample files of the four images.
You rock ;-)
Sometimes it is everything you tried, but 1 haha.