Image distort and compose
Posted: 2011-07-29T00:13:09-07:00
Hi,
I'm trying to use the command line tools to do some image work. I'm trying to take an image, distort it (specifically skew and resize), then compose on a larger transparent background at a set pair of points.
My command so far is as follows:
convert -size 1600x1000 xc:none image1.png -matte -virtual-pixel transparent -distort Affine '0,0,230,336,1600,0,1160,310,1600,1000,1058,634,0,1000,100,536' -compose Over -geometry +0+0 -composite +repage output.png
What's happening is the image gets skewed and resized and composed but is placed in the middle of the image. If I use +distort the compose seems to be completely ignored.
It should be noted that the coords I use for the distort are the corners of the image in question. It should also be noted that the destination coords I use are specific coords picked out of photoshop, (I'm basically applying an image to a "shell" recipient image, therefore the destination coords are those that make the image I'm working on fit within the recipient, hope that makes sense). What I'm concerned about is what I've seen so far is that these coords are not matching up, so I'm assuming I'm missing something from the above query.
Thoughts?
I'm trying to use the command line tools to do some image work. I'm trying to take an image, distort it (specifically skew and resize), then compose on a larger transparent background at a set pair of points.
My command so far is as follows:
convert -size 1600x1000 xc:none image1.png -matte -virtual-pixel transparent -distort Affine '0,0,230,336,1600,0,1160,310,1600,1000,1058,634,0,1000,100,536' -compose Over -geometry +0+0 -composite +repage output.png
What's happening is the image gets skewed and resized and composed but is placed in the middle of the image. If I use +distort the compose seems to be completely ignored.
It should be noted that the coords I use for the distort are the corners of the image in question. It should also be noted that the destination coords I use are specific coords picked out of photoshop, (I'm basically applying an image to a "shell" recipient image, therefore the destination coords are those that make the image I'm working on fit within the recipient, hope that makes sense). What I'm concerned about is what I've seen so far is that these coords are not matching up, so I'm assuming I'm missing something from the above query.
Thoughts?