Jump to content
You must now use your email address to sign in [click for more info] ×

Warping Text onto a wave


John Rostron

Recommended Posts

Some time ago I presented a formula to plug into Equations to warp text along a wavy baseline. I promised to create a macro to perform this, but never got round to it. Well here is that macro and a library containing it.

Wavy Text.afmacro

Wavy Text.afmacros

The transformation is just a sine/cosine curve:

y=y-(h*a/3)*(b*sin(360*x/w/c)+(1-b)*cos(360*x/w/c))

The a parameter determines the amplitude. The default is a=0.5, which creates a wave that  reaches about half way to the top and bottom of the layer. 

The b parameter shifts the position of te wave along the horizontal axis.

The c parameter affects the wavelength. Reducing c gives more waves along the x-axis.

If you start with a text layer such as:

147699529_OriginalText.png.e649968b898d4fe53db88c870d468517.png

and apply the macro with the default parameters, you get:

414516505_WarpedText.png.3021ebcd4a43d3840105d09e83cc0f1f.png

The macro is designed to operate on a text object on a background. It needs the background to give it room. It begins by rasterizing the text to a pixel layer. It uses the height and width of the background layer to determine the amplitude and wavelength, not the height and width of the text itself.

To use this, I would suggest creating a new document of a size to hold the text, then warp it, then  place or copy it into the target document with an appropriate blending mode.

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

52 minutes ago, evtonic3 said:

Does this mean the UI to this is right around the corner? I'm excited!

I'm not sure what you mean by this.

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

57 minutes ago, evtonic3 said:

Does this mean the UI to this is right around the corner? I'm excited!

John is a user, not a Serif developer.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

It's also handy to make wavy lines! :)

Acer XC-895 : Core i5-10400 Hexa-core 2.90 GHz :  32GB RAM : Intel UHD Graphics 630 : Windows 10 Home
Affinity Publisher 2 : Affinity Photo 2 : Affinity Designer 2 : (latest release versions) on desktop and iPad

Link to comment
Share on other sites

On 3/13/2019 at 5:17 PM, evtonic3 said:

Just excited to see any resemblance of text warping.

Well in APh using equations here will always yield to a pixel based representation of the modified text or shapes then ...

warp_equation.jpg.96a50d43ae80491f79d3a8df0449c4a8.jpg

On 3/13/2019 at 5:17 PM, evtonic3 said:

What I meant was since warping can be done mathematically, could a true warp function similar to other apps (AI Warp)  be close to bringing it Affinity apps as well? ...

What you probably mean is then on the plain vector side (AD) instead, so things like envelope distortion or freeform distortion of vectors/shapes which are sadly missing there in AD. - It's something which needs to be still implemented for AD, so people don't have to switch over to use AI, Inkscape, Magix/Xara, ... etc. instead for performing such tasks.

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

  • 1 year later...

evtonic3, there is another way to apply wave effect on layer(s) by using different distort filter called "Shear" in Affinity Photo.
It has good use, because you can control it manually and knowledge about linear equations is no needed.

Unfortunately... this option requires some time, because we need to set the curved lines properly by "trial and error" method.
If you will want to give the same wave effect on another layer, which has a different dimension, then the line will go differently.
You can see these differences on attached image - I made it on a darker background to not strain my eyes.

Best Regards,
Michael

wave-shear.jpg

Link to comment
Share on other sites

  • 9 months later...

@yoroshi, I have just discovered your post. I had not realised that the Distort > Shear filter was so flexible.

I did find though, that that adjusting the points was rather fraught. A tiny movement can have a large effect on the curve, and on the image!

I will need to have a further play with this.

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

Well the whole with bitmaps/rasterization based distortions is generally always a pain here. What would be instead much better and badly needed is some vector based distortion scheme, ideally then in a reusable manner, so that one and the same distortion settings can be reused/applied for other objects too.

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

On 1/6/2021 at 2:54 AM, MxHeppa said:

in this distort shear i cannot use formula? looks like no.

No, there is nowhere in the Distort > Shear dialogue where you  could enter a formula. If you use Distort > Equations, then you can apply formulae.

On 1/6/2021 at 2:54 AM, MxHeppa said:

Ps. these macros are affinity photo only?

Yes, I am afraid so.

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

  • 1 month later...
  • Staff

@Josie

If anyone wants to help they should probably do it in your thread on this topic

 

Patrick Connor
Serif Europe Ltd

"There is nothing noble in being superior to your fellow man. True nobility lies in being superior to your previous self."  W. L. Sheldon

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.