Bulge and pinch

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
alioscopy
Posts: 2
Joined: 2011-08-26T08:28:55-07:00
Authentication code: 8675308

Bulge and pinch

Post by alioscopy »

I am trying to bulge the top part of an image and at the same time to pinch the bottom part. I haven't figured out if this was possible using -distort Barrel.

Here is an example of what I would like to achieve. Would anyone know how to proceed?

Image

Thank you for you insights!
alioscopy
Posts: 2
Joined: 2011-08-26T08:28:55-07:00
Authentication code: 8675308

Re: Bulge and pinch

Post by alioscopy »

Oops, I wasn't careful that Anthony had already answered this question on another post. I will therefore try to use -wave.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Bulge and pinch

Post by fmw42 »

see also -distort arc at http://www.imagemagick.org/Usage/distorts/#arc
but a half wave is probably simpler, see http://www.imagemagick.org/Usage/warping/#wave
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bulge and pinch

Post by anthony »

It may be possible to use barrel for this, if the 'center' of the distortion is set to somewhere below the rectangle. I even provided the means by which the center can be specified. However I have not played with offset-centered barrel, and do not know just what can be done, and what effects the 'normalized radius' would have on the overall result.

It may be that exactly what normalized radius is used may need tweeking to get something more usable. I know for a fact that in on of my 'reflection' examples, I found that using a different aspect ratio image had marked impact on the results as the image height changed when the width didn't, thus effecting the barrel 'normalized radius' input.

For the example I talk about see...
http://www.imagemagick.org/Usage/advanced/#reflections
Specifically
Image
ASIDE: this image actually breaks the 'rules about reflections' but looked too cool to not include it in reflections, as it had come up a number of times in previous discussions.

It may be that you would need to add a 'fake and temporary extension' below the main image to achieve the desired (or other interesting) results. If someone does try this, please publish your results in this forum, if not this discussion, as it would be of interest to many people.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply