Remove the tile effect from a distort

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
apopen
Posts: 3
Joined: 2012-02-11T08:53:38-07:00
Authentication code: 8675308

Remove the tile effect from a distort

Post 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:

Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Remove the tile effect from a distort

Post 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
apopen
Posts: 3
Joined: 2012-02-11T08:53:38-07:00
Authentication code: 8675308

Re: Remove the tile effect from a distort

Post 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):

Image

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

Re: Remove the tile effect from a distort

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
apopen
Posts: 3
Joined: 2012-02-11T08:53:38-07:00
Authentication code: 8675308

Re: Remove the tile effect from a distort

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

Re: Remove the tile effect from a distort

Post by fmw42 »

Post Reply