Curve (arch) one side of an image

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?".
Locked
User avatar
MrJoyner95
Posts: 3
Joined: 2020-03-10T00:50:29-07:00
Authentication code: 1152
Location: Istanbul, Turkey

Curve (arch) one side of an image

Post by MrJoyner95 »

Hi, I'm trying to curve one side of an image, kind of like the barrel effect but only in one side. I already checked the documentation and I found http://www.imagemagick.org/Usage/warping/#wave and http://www.imagemagick.org/Usage/distorts/#shepards, it looks like they could be helpful but they don't do exactly what I need.

This is the result I want to get:
Image

By the way, I'm gonna apply this to texts but I'm converting and using them as images after customizing them, this effect would be on images then.
Thanks in advance for your help! :D

Note: the platform I'm working in is Debian 8.11 and the IM version is ImageMagick 6.8.9-9 Q16 x86_64
Last edited by MrJoyner95 on 2020-03-10T23:41:31-07:00, edited 1 time in total.

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Curve (arch) one side of an image

Post by snibgo »

What version of IM, on what platform?

I would probably use one of the methods I show on Straightening two lines. Make an image with one straight line for the base, and a curved line for the top of the text. The method shown on that page makes a displacement map from these lines, and the inverted map can then be used to distort the image with text.
snibgo's IM pages: im.snibgo.com

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Curve (arch) one side of an image

Post by fmw42 »

If on Unix-like system, see my texteffect script at my link below. I do that using -distort barrelinverse.

User avatar
MrJoyner95
Posts: 3
Joined: 2020-03-10T00:50:29-07:00
Authentication code: 1152
Location: Istanbul, Turkey

Re: Curve (arch) one side of an image

Post by MrJoyner95 »

The platform I'm working on is Debian 8.11 and the IM version is 6.8.9-9. I checked the script and the solution looks plausible, but how can I apply it in my environment?
snibgo wrote:
2020-03-10T02:13:12-07:00
What version of IM, on what platform?

I would probably use one of the methods I show on Straightening two lines. Make an image with one straight line for the base, and a curved line for the top of the text. The method shown on that page makes a displacement map from these lines, and the inverted map can then be used to distort the image with text.

User avatar
MrJoyner95
Posts: 3
Joined: 2020-03-10T00:50:29-07:00
Authentication code: 1152
Location: Istanbul, Turkey

Re: Curve (arch) one side of an image

Post by MrJoyner95 »

Yes I'm working on Debian 8.11, I have seen that script and it does what I want but I'm applying a lot of customizations to the text in a single command and that script doesn't allow me to apply all the customizations that I want. For example, this is a simplified version of the command I'm using:

Code: Select all

convert image.png \( -matte -virtual-pixel transparent -background transparent -size 900x200 -fill '#000000'  -interline-spacing 0 -stroke '#000000' -strokewidth 0 -gravity center label:"Lorem Ipsum Dolor Sit Amet Consectetur." -crop 900x200+0+0 +repage +distort ScaleRotateTranslate 0 \) -gravity northwest -geometry +0+0 -composite image.png
Is there a way to use that script and get the text back formatted in order to use it inside the same command? Or any other possible way to combine them both?
fmw42 wrote:
2020-03-10T09:00:32-07:00
If on Unix-like system, see my texteffect script at my link below. I do that using -distort barrelinverse.

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Curve (arch) one side of an image

Post by fmw42 »

Is there a way to use that script and get the text back formatted in order to use it inside the same command? Or any other possible way to combine them both?
I do not understand what you mean by "formatted"

Can you explain further?

Locked