Page 1 of 1

Best methods for layering and perspective shearing

Posted: 2011-02-23T14:20:09-07:00
by Tagomago
I'm getting into the funner stuff of Imagemagick... below is an attempt to overlay and image onto another. I've sorta got it, but I'm interested to hear suggestions. I've got no problem with the simple combination of images ( -draw "image Over x,x,x,x .jpg" ...) but I'm hoping to obtain cutouts in the top image that reveal the layer underneath.

The larger image was a .psd where I selectively removed a most of a section of wall, leaving a cherry picker and some texture remants. I saved it as a jpg, therefore flattening the image - does this effectively change what was empty to white? I'm thinking not, because one of these attempts partially works.

Most recently I did

Code: Select all

convert -size 967x558 xc: -draw "image Over 195,0 595,296 test.jpg" output.png

convert -draw "image Over 0,0 0,0 wall3.jpg " canvasunder2.png canvasover2.jpg 
That obscured the "test.jpg" image from the first section of code.

Image

So instead I tried multiply:

Code: Select all

convert -size 967x558 xc: -draw "image Over 195,0 595,296 test.jpg" output.png

convert -draw "image Multiply 0,0 0,0 wall3.jpg " canvasunder2.png canvasover2.jpg 
Image

And that did a decent job, but it partially obscures the top layer - which i expected it to do, based on it's description.

What I'm asking is I'm not sure what operator or what method of composting images would work better to allow full clarity to both images where they overlap.



*And finally -

At some point I'm going to not only want to shear images, but shear them in perspective. I haven't seen a method for that in "the definitive guide to ImageMagick" or on this page about "warping" http://www.imagemagick.org/Usage/warping/ Am I missing it, or could someone point me to another link?

Thanks!

Re: Best methods for layering and perspective shearing

Posted: 2011-02-23T18:38:34-07:00
by fmw42
why are you using -draw for compositing. You should be using one of the layers constructs.

see http://www.imagemagick.org/Usage/layers/

Re: Best methods for layering and perspective shearing

Posted: 2011-02-23T19:21:32-07:00
by anthony
Also what was your original images? Just some pointers will be fine.