Page 1 of 1

Newbie: Help with Arc distortion variant

Posted: 2008-12-23T08:06:00-07:00
by Turing Complete
I want to do the following distortion:

Image

Is there a specific name for this?

Is there a built in tool to do it?

If I need to use -fx, could someone give me a hand with it?

Thanks all.

Re: Newbie: Help with Arc distortion variant

Posted: 2008-12-23T12:55:32-07:00
by fmw42
see barrel distortion http://www.imagemagick.org/Usage/distorts/#barrel

see Anthony's rose examples

you need to combine half of two images, top half of bulge (barrel) and bottom half of pinch (pincushion)

rose.jpg
Image

convert rose.jpg -matte -virtual-pixel transparent \
-distort Barrel "0.0 0.0 0.0 1.0 0.0 0.0 0.5 0.5" \
barrel_bulge.png
Image

convert rose.jpg -matte -virtual-pixel transparent \
-distort Barrel "0.0 0.0 0.0 1.0 0.0 0.0 -0.5 1.9" \
barrel_pinch.png
Image


convert barrel_bulge.png[70x23+0+0] barrel_pinch.png[70x23+0+23] -append barrel_bulge_pinch.png
Image


In one long command line it would be:

convert rose.jpg \
\( -clone 0 -matte -virtual-pixel transparent \
-distort Barrel "0.0 0.0 0.0 1.0 0.0 0.0 0.5 0.5" -crop 70x23+0+0 +repage \) \
\( -clone 0 -matte -virtual-pixel transparent \
-distort Barrel "0.0 0.0 0.0 1.0 0.0 0.0 -0.5 1.9" -crop 70x23+0+23 +repage \) \
-delete 0 -append barrel_bulge_pinch.png


see http://www.imagemagick.org/Usage/basics/#image_seq
for parenthesis and image sequence processing

Good reading at:

http://www.imagemagick.org/Usage/

and

http://www.imagemagick.org/script/comma ... ptions.php

Re: Newbie: Help with Arc distortion variant

Posted: 2008-12-23T17:18:32-07:00
by Turing Complete
Thanks for taking the time to answer my question. Unfortunately your suggestion gives

Image

when what I'm looking for is

Image

Is there something else to try?

Re: Newbie: Help with Arc distortion variant

Posted: 2008-12-23T21:42:38-07:00
by anthony
Use the older -wave distortion.

http://www.imagemagick.org/Usage/distorts/#wave

this offsets each column of the image according to the sine-wave you specified. A half cycle sin wave looks exactly like what you want.