Perspective Distortion by command line doesn't works

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
sabater_wb

Perspective Distortion by command line doesn't works

Post by sabater_wb »

I'm trying to run the code bellow in the windows xp prompt:

"convert image.jpg -matte -virtual-pixel transparent -distort Perspective '0,0,0,0 0,262,0,262 240,0,240,37 240,262,240,237' result.png"

but I got this error:

convert: invalid argument for option '-distort ': '0,0,0,0, @ convert.c/ConvertImageCommand/1167

but in a linux server it runs perfect
exec("convert image.jpg -matte -virtual-pixel transparent -distort Perspective '0,0,0,0 0,262,0,262 240,0,240,37 240,262,240,237' result.png");
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Perspective Distortion by command line doesn't works

Post by Bonzo »

Try changing the ' to "
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Perspective Distortion by command line doesn't works

Post by anthony »

See also IM Examples, APIs, Scripting, Building, Windows DOS Batch Scripts
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
sabater_wb

Re: Perspective Distortion by command line doesn't works

Post by sabater_wb »

:D thank you Bonzo.
It worked.
sabater_wb

Re: Perspective Distortion by command line doesn't works

Post by sabater_wb »

I tryed it. Its working, but the result lost quality, and I need to add the paramter -unsharp 0x1 to the result be a few better.

Do you know if there are another way to save with a better quality ? because -unsharp 0x1 is not so good.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Perspective Distortion by command line doesn't works

Post by fmw42 »

By default -distort perspective uses elliptically weighted area filtering to avoid aliasing artifacts. But you can use other filters using the -filter setting. To turn off filtering use -filter point. To use the best non-area filter, try -filter lanczos.

See

http://www.imagemagick.org/script/comma ... php#filter
http://www.imagemagick.org/Usage/resize/#filter
http://www.imagemagick.org/Usage/distorts/#distort
Post Reply