John Rostron Posted February 21, 2019 Posted February 21, 2019 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: 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 stevemwallace, Gnobelix, Digbydo 2 and 4 others 5 2 Quote Windows 11, Affinity Photo 2.4.2 Designer 2.4.2 and Publisher 2.4.2 (mainly Photo). CPU: Intel Core i5 8500 @ 3.00GHz. RAM: 32.0GB DDR4 @ 1063MHz, Graphics: 2047MB NVIDIA GeForce GTX 1050
Ganna Posted February 21, 2019 Posted February 21, 2019 I would love to have that macro, please John Rostron 1 Quote
MarcBr Posted February 22, 2019 Posted February 22, 2019 Absolutely brilliant @John Rostron! Edit: yes, a macro would be great Quote
v_kyr Posted February 25, 2019 Posted February 25, 2019 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. How the applied filter effects look can be immediately inspected then and seen if you expand the used test image inside ... 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. John Rostron and stevemwallace 1 1 Quote ☛ 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
John Rostron Posted February 25, 2019 Author Posted February 25, 2019 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 Quote Windows 11, Affinity Photo 2.4.2 Designer 2.4.2 and Publisher 2.4.2 (mainly Photo). CPU: Intel Core i5 8500 @ 3.00GHz. RAM: 32.0GB DDR4 @ 1063MHz, Graphics: 2047MB NVIDIA GeForce GTX 1050
v_kyr Posted February 25, 2019 Posted February 25, 2019 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. Quote ☛ 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
John Rostron Posted February 26, 2019 Author Posted February 26, 2019 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: And here is the image with the macro applied: 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 Quote Windows 11, Affinity Photo 2.4.2 Designer 2.4.2 and Publisher 2.4.2 (mainly Photo). CPU: Intel Core i5 8500 @ 3.00GHz. RAM: 32.0GB DDR4 @ 1063MHz, Graphics: 2047MB NVIDIA GeForce GTX 1050
v_kyr Posted February 27, 2019 Posted February 27, 2019 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. John Rostron 1 Quote ☛ 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
John Rostron Posted February 27, 2019 Author Posted February 27, 2019 I have just posted an example of this in the Share your work Forum. John Ganna 1 Quote Windows 11, Affinity Photo 2.4.2 Designer 2.4.2 and Publisher 2.4.2 (mainly Photo). CPU: Intel Core i5 8500 @ 3.00GHz. RAM: 32.0GB DDR4 @ 1063MHz, Graphics: 2047MB NVIDIA GeForce GTX 1050
John Rostron Posted February 28, 2019 Author Posted February 28, 2019 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 Quote Windows 11, Affinity Photo 2.4.2 Designer 2.4.2 and Publisher 2.4.2 (mainly Photo). CPU: Intel Core i5 8500 @ 3.00GHz. RAM: 32.0GB DDR4 @ 1063MHz, Graphics: 2047MB NVIDIA GeForce GTX 1050
catlover Posted March 1, 2019 Posted March 1, 2019 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. John Rostron 1 Quote
John Rostron Posted March 1, 2019 Author Posted March 1, 2019 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 Quote Windows 11, Affinity Photo 2.4.2 Designer 2.4.2 and Publisher 2.4.2 (mainly Photo). CPU: Intel Core i5 8500 @ 3.00GHz. RAM: 32.0GB DDR4 @ 1063MHz, Graphics: 2047MB NVIDIA GeForce GTX 1050
catlover Posted March 1, 2019 Posted March 1, 2019 Sorry, forgot : There's an Aff Macro called "Distortions", it has a "Lake Surface" macro within. See attachment. Distortions.afmacros Quote
John Rostron Posted March 1, 2019 Author Posted March 1, 2019 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 Quote Windows 11, Affinity Photo 2.4.2 Designer 2.4.2 and Publisher 2.4.2 (mainly Photo). CPU: Intel Core i5 8500 @ 3.00GHz. RAM: 32.0GB DDR4 @ 1063MHz, Graphics: 2047MB NVIDIA GeForce GTX 1050
John Rostron Posted March 1, 2019 Author Posted March 1, 2019 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 Quote Windows 11, Affinity Photo 2.4.2 Designer 2.4.2 and Publisher 2.4.2 (mainly Photo). CPU: Intel Core i5 8500 @ 3.00GHz. RAM: 32.0GB DDR4 @ 1063MHz, Graphics: 2047MB NVIDIA GeForce GTX 1050
John Rostron Posted March 3, 2019 Author Posted March 3, 2019 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 Quote Windows 11, Affinity Photo 2.4.2 Designer 2.4.2 and Publisher 2.4.2 (mainly Photo). CPU: Intel Core i5 8500 @ 3.00GHz. RAM: 32.0GB DDR4 @ 1063MHz, Graphics: 2047MB NVIDIA GeForce GTX 1050
v_kyr Posted March 4, 2019 Posted March 4, 2019 John, in case you are interested in seeing an other Ripples filter implementation (made in Java here) and how that shows up then ... screencast_ripples.mp4 Quote ☛ 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
v_kyr Posted March 4, 2019 Posted March 4, 2019 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 ... screencast_swim.mp4 Quote ☛ 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
catlover Posted March 4, 2019 Posted March 4, 2019 Hi, V_Kyr: Any chance of making your macro available for download ? Please also see John's Post that this thread has been moved to "Resources". Thanks, C.L. Quote
v_kyr Posted March 4, 2019 Posted March 4, 2019 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. Quote ☛ 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
catlover Posted March 4, 2019 Posted March 4, 2019 OK, thank you. I totally misunderstood C.L. v_kyr 1 Quote
v_kyr Posted March 4, 2019 Posted March 4, 2019 @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 ... Java image filters The Java image filters implementation (for those who code in Java) A Java Image Editor app to try and test those filters Other Java based image apps with certain implemented image filters ... Imager Pixelitor ... and so on, too much to list them all ... Quote ☛ 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
MarcBr Posted March 6, 2019 Posted March 6, 2019 @John Rostron That macro is nuts! Absolutely in love with it Check out this small edit (still in progress): 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 Quote
Recommended Posts
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.