Page 1 of 1
Remove the tile effect from a distort
Posted: 2012-02-11T09:16:58-07:00
by apopen
I'm trying to distort an image to an angle, which I have done, but can't seem to remove the tile effect that occurs after the rotation of the image.
I'm on Ubuntu 11, via shell script and running the following:
Version: ImageMagick 6.6.0-4 2011-06-15 Q16
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP
The command I have is as follows:
Code: Select all
convert tmp_center_done.png -matte -virtual-pixel Transparent -alpha set -background White +distort AffineProjection 1,-.3,0,1,0, +repage tmp_center_done_shear.png
Any help or points in the right direction. In the end, I'm trying to get this picture to tilt its perspective and wrap around a "imagingary" 3inch deep picture frame...have most of it going already (i.e. slicing the image up and putting it back together around the frame, just can't remove these lines).
Thanks,
Paul
The resulting image is as follows:

Re: Remove the tile effect from a distort
Posted: 2012-02-11T10:43:12-07:00
by fmw42
Your version of IM may be too old to support -virtual-pixel transparent or had a bug. It is getting the default value of edge. You can try -virtual-pixel background -background none, but I cannot assure you that will work either.
Try also removing the -alpha set as that is the same as -matte and add -channel rgba
convert tmp_center_done.png -channel rgba -matte -virtual-pixel Transparent +distort AffineProjection 1,-.3,0,1,0, +repage tmp_center_done_shear.png
or
convert tmp_center_done.png -channel rgba -matte -background none -virtual-pixel background +distort AffineProjection 1,-.3,0,1,0, +repage tmp_center_done_shear.png
If these work, then try removing -channel rgba and then try removing -matte (or -alpha set) to see if they are necessary.
If these do not work, then upgrade IM
Re: Remove the tile effect from a distort
Posted: 2012-02-12T07:13:00-07:00
by apopen
Thanks for the quick reply and the great information.
I decided to take the (what I thought) quick route in upgrading my IM install on Ubuntu. Had to manually compile and account for PNG/JPG delegates, but got through that.
Ran the same script again and it worked as expected.
Now on to optimizing the script. FYI the final result was as follows (minus the slight drop shadow I plan on adding to the back of the frame):
Actually, while I'm here, have a few additional questions. This is really my first kick at the can dealing with IM, so I'm positive my script is not that optimal in any fashion (i.e. each step is done in a seperate command writing the image to disk). I'm going to try to merge as many of the commands together, but wanted to know if its common for people to post scripts here to ask for optimization help (I'll try my best before posting though)?
Paul
Re: Remove the tile effect from a distort
Posted: 2012-02-12T07:20:38-07:00
by anthony
You did very well.
You can post a specific problem or command, and we can try to optimize it, but best to avoid posting whole scripts (unless sharing it, much like Fred does on his web site).
Basically people are not usually willing to 'learn' a script, just to debug or optimize it.
Re: Remove the tile effect from a distort
Posted: 2012-02-12T07:47:44-07:00
by apopen
Fair enough as I do understand how complex some of these scripts can get. I'm more than willing to share all scripts I develop for others to learn from my mistakes
I'll push forward and add the dropshadows and try combining some of the operations.
Paul
Re: Remove the tile effect from a distort
Posted: 2012-02-12T13:52:21-07:00
by fmw42