Mask not working

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Mask not working

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Mask not working

Post by snibgo »

You are setting transparency of an image, then saving it as JPG, which can't store transparency.
snibgo's IM pages: im.snibgo.com
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: Mask not working

Post 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. 
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Mask not working

Post 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 :?
Last edited by Bonzo on 2016-08-21T10:12:22-07:00, edited 1 time in total.
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: Mask not working

Post by agriz »

Thank you for the advice sir. I will try as you advised. I will let you know what i got :)
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: Mask not working

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Mask not working

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply