overlaying images with another image at different distortion
Posted: 2011-10-19T10:37:37-07:00
I have many images that I am trying to overlay another image on top of at different distortions. To illustrate, please take a look at the image at this link:
http://www.bodymindsystems.com/sites/bm ... verlay.jpg
I have been using 'rotate' and 'shear' with different angle parameters to accomplish this somewhat successfully, ultimately running the following command (with different angle parameters of course):
convert candyimage.png \( IBM.eps -resample 144x144 -trim -resize 90x40\> -matte -background none -rotate -20 -shear 35x35 \) -geometry +186+65 -composite candyimage-result.png
Now however, I am trying to do harder distortions like the image in the bottom left of the link image above. There, I am unable to place the IBM logo with a distortion that needs to look sort of like a perspective because of how the angle of that container is on which IBM logo needs to rest on. To the end user looking at the image, it must look like as if the IBM logo was imprinted on top of the container.
Researching imageMagick, I found 'distort Affine' and my question is if there is any way to successfully do so? Secondly, can I use it for all of my images getting rid off 'rotate' and 'shear' which I find too consuming to configure. (I am trying to have one single command list that can be applied to all images to make it as efficient as possible to configure each -- distort Affine feels like it should be able to do the job and cover all of my needs -- can it?)
When I try the following 'distort Affine' on the image in the bottom left, I get the logo unchanged even though the image is converted to 49x20 so I am shifting it which should be resulting in a distortion.
convert candyimage.png \( IBM.eps -resample 72x72 -trim -resize 49x20\> -matte -background none -distort Affine '0,20 39,20 20,0' \) -geometry +186+65 -composite candyimage-result.png
Lastly, once distorted, it seems the resulting image gets cut off. How do I adjust the command to make sure that it correctly resizes the image to make room for now distorted image of new size?
http://www.bodymindsystems.com/sites/bm ... verlay.jpg
I have been using 'rotate' and 'shear' with different angle parameters to accomplish this somewhat successfully, ultimately running the following command (with different angle parameters of course):
convert candyimage.png \( IBM.eps -resample 144x144 -trim -resize 90x40\> -matte -background none -rotate -20 -shear 35x35 \) -geometry +186+65 -composite candyimage-result.png
Now however, I am trying to do harder distortions like the image in the bottom left of the link image above. There, I am unable to place the IBM logo with a distortion that needs to look sort of like a perspective because of how the angle of that container is on which IBM logo needs to rest on. To the end user looking at the image, it must look like as if the IBM logo was imprinted on top of the container.
Researching imageMagick, I found 'distort Affine' and my question is if there is any way to successfully do so? Secondly, can I use it for all of my images getting rid off 'rotate' and 'shear' which I find too consuming to configure. (I am trying to have one single command list that can be applied to all images to make it as efficient as possible to configure each -- distort Affine feels like it should be able to do the job and cover all of my needs -- can it?)
When I try the following 'distort Affine' on the image in the bottom left, I get the logo unchanged even though the image is converted to 49x20 so I am shifting it which should be resulting in a distortion.
convert candyimage.png \( IBM.eps -resample 72x72 -trim -resize 49x20\> -matte -background none -distort Affine '0,20 39,20 20,0' \) -geometry +186+65 -composite candyimage-result.png
Lastly, once distorted, it seems the resulting image gets cut off. How do I adjust the command to make sure that it correctly resizes the image to make room for now distorted image of new size?