Best methods for layering and perspective shearing

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
Tagomago
Posts: 36
Joined: 2011-02-10T09:55:33-07:00
Authentication code: 8675308

Best methods for layering and perspective shearing

Post 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!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Best methods for layering and perspective shearing

Post 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/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Best methods for layering and perspective shearing

Post by anthony »

Also what was your original images? Just some pointers will be fine.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply