Page 1 of 1

Perspective Distortion by command line doesn't works

Posted: 2009-01-13T13:00:09-07:00
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");

Re: Perspective Distortion by command line doesn't works

Posted: 2009-01-13T13:59:11-07:00
by Bonzo
Try changing the ' to "

Re: Perspective Distortion by command line doesn't works

Posted: 2009-01-13T17:34:10-07:00
by anthony
See also IM Examples, APIs, Scripting, Building, Windows DOS Batch Scripts

Re: Perspective Distortion by command line doesn't works

Posted: 2009-01-13T18:29:12-07:00
by sabater_wb
:D thank you Bonzo.
It worked.

Re: Perspective Distortion by command line doesn't works

Posted: 2009-01-13T22:08:15-07:00
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.

Re: Perspective Distortion by command line doesn't works

Posted: 2009-01-13T23:04:14-07:00
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