distort equivalent on version 6.2.8

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
bhattkrishna19

distort equivalent on version 6.2.8

Post by bhattkrishna19 »

We want to modify an image (png file) so that it become visible like it's an item viewed from a distance. We do it by distorting it as follows
> convert sample.png -mattecolor none -virtual-pixel background -background transparent -distort Perspective "0,0 242,208 300,0 246,258 0,450 39,199 300,450 32,265" tilted_sample.png

We want to place this 3d view of the image inside another image and hence we know the 4 coordinates of the image in which this distorted image has to be placed.

But the ditort command only works with latest version of Image magick and not version 6.2.8 . Is there an alternate way to shear it but through coordinates and not through x and y % of shear.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: distort equivalent on version 6.2.8

Post by Bonzo »

What about -affine or -transform ?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: distort equivalent on version 6.2.8

Post by fmw42 »

you can use -fx to create your own perspective projection equations as per http://www.imagemagick.org/Usage/distor ... projection but you will need to solve the perspective equations for the coefficients from your control points yourself.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: distort equivalent on version 6.2.8

Post by anthony »

Bonzo wrote:What about -affine or -transform ?
These do not generate distance perspective.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply