Jump to content
John Rostron

Using Equations in Distort - Parameter won't work

Recommended Posts

@atfitzy posted a thread about re-shaping a text block. I tried various Equations in Filter> Distort and the best I could come up with is:

x=x

y+(h-y)*(w-x)*x/w/w/a

This produces the required arch in the upper margin of the block. The a parameter allows the user to increase the stretching effect. The default of one has no effect; reducing it will increase the effect. However, I find that reducing the parameter has no effect until the value goes below half, after which it has the desired effect. I can get the desired effect by putting a multiplier at the start of the equation:

y+2*(h-y)*(w-x)*x/w/w/a

Here are a couple of arched images using this formula:

5a5a3cf19c9a8_BenguiatBlackDist.png.04d7b1970af32fc66a2aaa338bf5a2ea.png

5a5a3d086ea55_GridPatternDist.thumb.png.0a096c5715cd2551650a1205a9fe311e.png

Otherwise the formula works as desired. Before I commit this to a macro can anyone explain this unexpected behaviour in the parameter value?

John


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

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

Share this post


Link to post
Share on other sites
1 hour ago, stokerg said:

Hi John,

 

This is a bit over my head but hopefully @James Ritson or @Andy Somerfield would be able to clear up why it's acting the way it does

Thanks, @stokergI will live in hope.

John


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

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

Share this post


Link to post
Share on other sites

Works for me when applied on a custom SVG grid under OSX. - The default of one has an streching effect on the grid here and also altering the "a" parameter slider continously updates the whole streching effect.


☛ Affinity Designer 1.8.3 ◆ Affinity Photo 1.8.3 ◆ OSX El Capitan

Share this post


Link to post
Share on other sites

The expression (w-x)*x/w/w should be zero at each end, rising to a maximum of 0.25 in the middle. Thus the arch should rise up a quarter of the current position above the x-axis (h-y). The a parameter at the default of 1 would have no effect. As a decreases, the value of the expression should rise in inverse proportion. It should do so strictly monotonically. It is not doing this on my Windows 10 PC. Note the 2* is just a fudge factor to make it behave as expected.

(Note that strictly monotonic means that the rise should always be positive and non-zero.)

John


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

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

Share this post


Link to post
Share on other sites

I have modified this equation from top a little bit. Please give a try - it should eliminates this A-jump.

y+(h*c-y)*(w-(x*b))*x/w/w/(a*0.5)

If B =1 and C = 0.5 than A is just scaling from the middle BUT!!! it works different for different layers (with different sizes).  

So my question is it possible that this filter is computing the whole canvas, not the size of the selected layer?


OSX 10.13.5  / iMac Retina 27" / AMD Radeon R9 M380 / Metall: on!

Share this post


Link to post
Share on other sites

@Polygonius, I shall have to work this one on both on paper and in Affinity. Thanks for your interest.

John


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

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

Share this post


Link to post
Share on other sites

@Polygonius, I have now tried your equations. Putting /(a*0.5) at the end is algebraically the same as I had with /a at the end and 2* at the beginning. However, I now find that the a parameter still does not cut in at first, but only when it reaches a value of about 0.7-0.8. Curiouser and curiouser! (The link explains the origin of this expression for those unfamiliar with it.)

Your use of parameters b and c are interesting. Parameter b just seems to scale along the y-axis, enhancing the value of a - not what I would have expected. Parameter c is more intriguing. It shifts the effective horizontal axis of the effect upwards. If this is used with an enhanced curve-shift (with parameter b), it gives the appearance of a rounded corner. I was applying these parameters to the square grid as in my first posting. Here is the grid with a=0.7, b=0.9 and c=0.3 (all values approximate).

5a76e7fa3a80f_GridPatternDist2.png.758406cfa33819c3b756e71a126da711.png

I am interested to see these effects on a real image!

John

Edited by John Rostron
Coirrected link!

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

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

Share this post


Link to post
Share on other sites
27 minutes ago, John Rostron said:

Curiouser and curiouser! (The link explains the origin of this expression for those unfamiliar with it.)

 

Dead link. :(

 


Alfred online2long.gif
Affinity Designer/Photo/Publisher for Windows • Windows 10 Home (4th gen Core i3 CPU)
Affinity Photo for iPad 1.8.4.186 • Designer for iPad 1.8.4.4 • iPadOS 13.7 (iPad Air 2)

Share this post


Link to post
Share on other sites
35 minutes ago, Alfred said:

Dead link. :(

 

alice.png.a11c66444b6e4f5b5328b32f08663af4.png


Affinity Photo 1.8.4, Affinity Designer 1.8.4, Affinity Publisher 1.8.4;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 40GB RAM; macOS 10.15.6
Affinity Photo 
1.8.4.186 & Affinity Designer 1.8.4.4 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.3.1

Share this post


Link to post
Share on other sites
36 minutes ago, Alfred said:

Dead link. :(

I have corrected this link.

John


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

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

Share this post


Link to post
Share on other sites
16 minutes ago, R C-R said:

 

alice.png.a11c66444b6e4f5b5328b32f08663af4.png

@R C-R, for a moment I thought that you had applied this filter to Alice and the pig. I must try it!

AliceWithPigDistort.png.392590742b227fc6cf3ec2224fb1c074.png

For Alice in Wonderland, a stretch transform seems appropriate. This has a=1, b=0, b=0.9, c=0.35 (all approximate).

John


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

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

Share this post


Link to post
Share on other sites
1 hour ago, John Rostron said:

For Alice in Wonderland, a stretch transform seems appropriate.

 

Or a shrink transform, depending on whether you’re illustrating “Eat Me” or “Drink Me”. ;)

 


Alfred online2long.gif
Affinity Designer/Photo/Publisher for Windows • Windows 10 Home (4th gen Core i3 CPU)
Affinity Photo for iPad 1.8.4.186 • Designer for iPad 1.8.4.4 • iPadOS 13.7 (iPad Air 2)

Share this post


Link to post
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

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | 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.