Passing a negative angle to Arc Distortion

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
javiersm

Passing a negative angle to Arc Distortion

Post by javiersm »

Good Morning,

I have a doubt, I wrote this function to make a text effect:

Code: Select all

        double dargs[1] ;
        dargs[0] = -35;
        MagickDistortImage(wand, ArcDistortion, 1, dargs, MagickTrue );
The problem is when I give to the function this value (a negative one) the text is not getting distorted, is something wrong? or this function not allows negatives values in angle? Is there any other way to get the text bended in a negative angle? thanks a lot!

Best regards.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Passing a negative angle to Arc Distortion

Post by el_supremo »

Does this do what you want?

Code: Select all

dargs[0] = 360-35;
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
javiersm

Re: Passing a negative angle to Arc Distortion

Post by javiersm »

Hi,

I tried that angle too, but makes a concave form too, what I would like to generate is the opposite one, a convex one. thanks for your attention!, best regards.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Passing a negative angle to Arc Distortion

Post by anthony »

I never designed Arc with negative angles in mind. I mean mathematically it does not make sense, though logically it does.

If you want to reverse the directon of the arc the simplist way is as given in IM examples. pre-rotate the text image so that it is upside-down, and add a 180 rotation offset argument to rotate it back as part of the Arc distort.

convert -font Candice -pointsize 20 label:' Around the World ' \
-virtual-pixel Background -background SkyBlue \
-rotate 180 -distort Arc '270 180' arc_flip.jpg
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply