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

Recommended Posts

I was speculating on how Equations could be used to create a ripple-like effect in a reflection. I used an image of a Mill on the River Avon at Tewkesbury. I flipped the image vertically and then applied Filter > Distort > Equations as follows.

The main effect is to vary the position of each pixel on the y-axis in a sinusoidal fashion, so I began with:

y=y+100*sin(2*360*y/h)

The 100 is just a scaling factor for now. This had the right effect but was the same right across the image, so I added a cosine function which would vary the magnitude across the x-axis:

y=y+100*cos(10*x/w)*sin(2*360*y/h)

Again the 10 here is a scaling factor. The result was:

666765011_TewkesburyMillRipples.jpg.0b23cc480cb20af0e851e2b1296ddabb.jpg 

I should be able to tweak this into a macro where the user could vary the amplitude of the ripple, and the amplitude of the horizontal variation.

A further tweak could be to add a perspective effect so that the ripples nearer the observer look larger than those further away.

What do possible users think. Would this be a useful macro or are there easier ways to get the same effect?

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

On 2/21/2019 at 6:18 PM, John Rostron said:

I should be able to tweak this into a macro where the user could vary the amplitude of the ripple, and the amplitude of the horizontal variation.

I apply such things sometimes via programming code variations try outs, in order to see if certain filter functions do work the way they should or not. On a Mac such things can be done easily in Xcode playgrounds and a little bit of Swift hacking then, since the graphics APIs are already there for all kind of such things.

For example, here I've used the Apple core image API for applying waveline distortions to an image x-coordinate direction, the wavelength and amount values can be applied/adjusted individually. The same can be done for the y-coordinate direction, so you could apply custom adjusted wavelength distortions to both x,y if desired.

filter_coding.jpg.07af8504024a3448e739108ae5cc20b5.jpg

How the applied filter effects look can be immediately inspected then and seen if you expand the used test image inside ...

wasserschloss.jpg.e782827942a8b92bde85d814e0481580.jpg

That Apple API offers all the those filters the APh FX effects etc. stuff does have. - Though for ripple effects there is also a seperate CIRippleTransition core image filter available which then is fun to be combined with some core animation API stuff. That way you can animate image related stuff too.

BTW, a macro would be of course much better for APh (re)usage here, since fiddeling around with those expression text fields is IMO always a pretty annoying matter. Personally I'm more in favor and a friend of dynamic behaving interpreter shells here for 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

Thanks, @v_kyr Yours is an interesting approach. I do have some experience with scripting languages like Javascript, PHP and Python so I await, with bated breath,  the time when the Affinity apps offer a proper coding API. 

I do have a filter more-or-less ready for release, but I am having trouble making the parameters visible to the user, as you have seen in my bug report.

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 life can be too short to wait for an Affinity programming or scripting API, thus better start to program your own solution stuff now and yet instead and then be independent from maybe never seen or limited features here.

The parameter handling should usually work, I recall that I also tried it on Win versions some time before, even I use the Affinity stuff mostly on Macs due to the overall better performance and memory handling behavior.

☛ 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

I think that I now have a (more-or-less) working version. These is a single macro (Ripples.afmacro) within a library (Ripples.afmacros):

Ripples.afmacro

Ripples.afmacros

There are two parameters,

The first, a, controls the ripple frequency. reducing the value makes the ripples closer together (more ripples per inch).

The second, b, affects the variability of the ripple magnitude across the x-axis. By default (b=1), the ripple magnitude is the same across the width. Reducing b makes it more variable.

There are two additional additions to my earlier draft. The original ripples were a simple sine wave. They are now generated with the addition of a couple of smaller cosine waves with shorter wavelengths. This means that the ripples are not uniform.

The ripples are now visually further apart near the front of the image, and closer at the back, to simulate perspective. Neither of these two additions are controllable by the user. 

Here is a sample image (Mill on the River Avon at Tewkesbury:

827507340_TewkesburyMillFlipped25pc.jpg.f187625456d05d6ecf587b03fff6a48a.jpg

And here is the image with the macro applied:

1109383015_TewkesburyMillRipples25pc.jpg.abc0234690bbcc4b3180c67ad40e96a3.jpg

Note the artefact at the top of the image. I am not too worried about that since, in practice, the user would not be utilising that part.

I would envisage this being used on a flipped duplicate layer and blended into the reflective surface part of an image.

I would be interested to see an application of this that anyone has.

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

I think it's probably best used on certain selected image areas only, or then afterwards better finetuned via masking, in order to get a more realistic appearance. - However here is your macro when applied instead on the whole bottom rect area of an image.

ripple_test.jpg.6927ee211fb070a45ea5d1986a46ce69.jpg

 

☛ 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

I would welcome feedback on this macro. I have applied it to some images with impressive results and to others where it was a disaster!

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

Thank you very much John for your efforts.

I've tried your macro on various JPGs, but like you say : the results vary.
In the mean time I've found a "ripple"-plugin on Flaming Pear called "Flood", I'm sure you're aware of it, too.
Thought I'd mention it, though, just in case.

C.L.

 

Link to comment
Share on other sites

6 minutes ago, catlover said:

Thank you very much John for your efforts.

I've tried your macro on various JPGs, but like you say : the results vary.
In the mean time I've found a "ripple"-plugin on Flaming Pear called "Flood", I'm sure you're aware of it, too.
Thought I'd mention it, though, just in case.

C.L.

 

I do recall seeing the Flood plugin in the past, but I had forgotten about it when I was creating my macro. I must download the trial.

Thanks anyway.

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

51 minutes ago, catlover said:

Thank you very much John for your efforts.

I've tried your macro on various JPGs, but like you say : the results vary.
In the mean time I've found a "ripple"-plugin on Flaming Pear called "Flood", I'm sure you're aware of it, too.
Thought I'd mention it, though, just in case.

C.L.

 

I have just tried Flaming Pear Flood 2 and it does not work. The preview and the output are both corrupted. I will try the Distortions macro.

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

39 minutes ago, catlover said:

Sorry, forgot : There's an Aff Macro called "Distortions", it has a "Lake Surface" macro within.

See attachment.

Distortions.afmacros

I have just tried this and it seems to work. I shall explore it further. Thanks for the pointer.

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

I have updated this macro and have posted an appropriate message under Resources since it seems more appropriate there. Thanks to the various forum members who have responded.

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

BTW, a more wavy look for such distortions can be done with a Swim distortion called filter, which IMO often gives better looking results than the above shown Ripple one ...

☛ 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

I'm sorry that's no APh macro at all, those filters shown are Java graphics programming based here and thus their code is (re)usable in Java apps but not APh. - For APh those would need to be glued into a working plugin instead, in order to make any use out of them.

☛ 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

@catlover Well maybe I didn't named/explained that very well!

However, for those interested in this image filter materia, a bunch of Java graphics based implemented filters can for example be seen here ...

Other Java based image apps with certain implemented image filters ...

☛ 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

@John Rostron That macro is nuts! Absolutely in love with it :17_heart_eyes:

Check out this small edit (still in progress):

275034539_HandaraGate@Bali-3194_small.thumb.jpg.b82a663329700f196a5e7330350f8e6c.jpg

Some ideas for further improvement of the macro:

  • modulation / increment of the distance between each ripple in a selectable direction (in my edit it would give a better depth if the distance between each ripple increments towards the viewer of the photo)

FYI: Here are the adjustment layers I added to the water layer:

  • motion blur
  • gaussian blur
  • exposure adjustment
  • ripples live filter for a more 3d-ish global movement of the water surface

Cheers, Marc

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.