Page 1 of 1

Mask not working

Posted: 2016-08-20T08:51:45-07:00
by agriz

Code: Select all

convert input.jpg mask.png -alpha Off -compose CopyOpacity -composite output.jpg
Why am i getting the input image as output?
Why am i not getting any mask applied on it?

Whatever the input and mask images are, it is returning input.jpg as output.jpg

Re: Mask not working

Posted: 2016-08-20T09:10:43-07:00
by snibgo
You are setting transparency of an image, then saving it as JPG, which can't store transparency.

Re: Mask not working

Posted: 2016-08-20T09:18:35-07:00
by agriz
I got it sir. After converting it to png, it works.

Image
I am trying this effect.

Code: Select all

convert input.jpg ( -clone 0 mask.png -alpha off -gravity none -geometry +0+0 -compose copy_opacity -composite ) -delete 0 output.png
it works.

How do i create other slides?

convert input.jpg ( -clone 0 mask.png -alpha off -gravity none -geometry +0+0 -compose copy_opacity -composite ) ( -clone 0 mask.png -alpha off -gravity none -geometry +50+0 -compose copy_opacity -composite ) -delete 0 output.png

it is not working. 

Re: Mask not working

Posted: 2016-08-21T09:40:06-07:00
by Bonzo
I would probably crop the image into the separate sections, adding the white border and then place them on the canvas and finally add the drop shadow.

I do not see whay you need a mask or to alter the transparency.

This is some php code I wrote which may give you some ideas. It can be improved now as it was written quite a few years ago :?

Re: Mask not working

Posted: 2016-08-21T10:00:53-07:00
by agriz
Thank you for the advice sir. I will try as you advised. I will let you know what i got :)

Re: Mask not working

Posted: 2016-08-21T21:58:59-07:00
by agriz
Everything goes good according to use advice. I use +append to append the cropped images together. How do i position them? -gravity or -geometry is not working. Please advice

Re: Mask not working

Posted: 2016-08-22T00:28:00-07:00
by snibgo
There are many possible ways of doing this. When I look at the OP image, it seems to be a portrait that has been chopped into slices that have been rearranged. But it isn't. The are no discontinuities in the portrait at the boundaries between the slices.

So a possible solution is to take an ordinary image, then composite an image over it. That top image will contain a white border, four transparent sections, thin white lines between the transparent sections, and shadows.