Jump to content

Artistic Filters using Procedural Textures (Tutorial)


Recommended Posts

Like many others in the forum, I have discovered the power and usefulness of the Procedural Texture filter (go to Filters>Colours>Procedural Texture).

What I want to do in this thread is show how it can be used to create artistic effects like some of the artistic filters in Photoshop. In fact, I’ve discovered that it is better in some respects than PS, because there are so many ways which you can change them. Let me say right now that I have no, repeat NO knowledge of the maths (British spelling) or how to write the equations. All my discoveries have been made just by examining the existing equations and tinkering.

The aim here is to give some examples, show how they can be used and get input from other users with examples and uses, how they might be improved etc.

That said, here’s the first texture filter:

Notes:

You may want to first create an Art FX category in the Procedural Texture dialogue. Do this by clicking on the burger icon under the Reset button top right; select “Manage Presets” and “Create Category”.

I prefer using it as a live filter, making re-editable which is better for trial-and-error purposes (Layer>New Live Filter Layer>Colours>Procedural Texture).

 

Perlin Paint Patches Txtr (Procedural Texture)

This will create fully resizable patches of colour which can be varied from rough to smooth. These can be used as displacement maps (example below), colour overlays with layer blend modes, texturizing using the Emboss filter combined with layers modes, as a glass filter or any way you would use a texture in Photoshop (but better!).

Note: When using the Displace filter, if you set the strength value high enough you get an effect very similar to the Glass Filter in Photoshop. Also note that the colours of a texture used as a displacement map do not affect the colours in the image being displaced.

 

STEP 1

Create three equations by clicking on the + sign under the equations box. Note that each equation turns on and therefore will affect first the red channel, then the green channel and then the blue channel.

Copy and paste the equations below into the R,G,B equation lines.

perlinhcubic(rx/((w/2)/b),ry/((w/2)/c),7,a)

perlinhcubic(rx/((w/2)/d),ry/((w/2)/e),7,a)

perlinhcubic(rx/((w/2)/f),ry/((w/2)/g),7,a)

Create custom inputs to control the height and width of the noise patches in each channel, and another custom input to control the noisiness/smoothness of the noise. To do this click on the custom type indicated below by clicking on the relevant input type below the Custom Inputs section.

The first column is the input type, the second is the input parameter it affects in the equation, this is followed by the input name, and finally, the input value.

Custom Inputs

Type   Parameter       Name                                   Value

R          b                          Red Pattern Width         7          NOTE: Higher numbers make SMALLER patches

R          c                          Red Pattern Height        7

R          d                          Green Pattern Width    9

R          e                          Green Pattern Width    9

R          f                           Blue Pattern Width        8

R          g                          Blue Pattern Width        8

-1,1     a                          Noise Smoothness         Set slider to far left.

Save this as a new Procedural Texture preset by clicking on the burger icon top right, selecting ‘Create Preset’ and saving it the Art FX category you created earlier. A name such a Perlin Paint Patches might be suitable.

NOTE: The rx and ry in the equations makes the texture click-draggable. Click in the texture area and drag the cursor to see different areas of the texture.

STEP 2 - Use with the Displace filter to create various types of random brush strokes as follows:

Create a new layer below your image layer (ctrl+shift+n). Turn your image layer off for the moment so you can see the procedural texture we’ll create in a moment. Fill this layer with your foreground colour, (Edit>Fill with Primary Colour). Fill the new pixel layer with random patches of colour created by the Procedural Texture filter (Filters>Colours>Procedural Texture and then select the Perlin Paint Patches you just created above. There’s no OK button – just click the X top right and the texture is created.

Select and turn on your image layer.

Apply the Displace filter to generate brushstrokes of varying sizes, depending upon the amount of displacement you enter but leave it at the default 10px to start with, though the strength amount depends on the resolution of your image. Go to Filters>Distort>Displace, make sure Load Map from Layers Beneath is selected and click Apply. NOTE: Don't do this step as a live filter, for some reason that produces artifacts at the edges of the image.

Zoom in to see what’s happened. With a 10 pixel displacement of the default Perlin Paint Patches texture you get very rough paint.

Smooth the paint, if you wish, with a low Median Blur – eg. 2px (this too depends on image resolution.)

Already you should be able to grasp the HUGE variety of paint FX just from these two filters each of which can be saved as a Macro to make a one-click artistic filter. With so many variable controls in just this one Procedural Texture there you know you're going to spend DAYS just playing with them to see what happens.

EXTRA STEP – Create sub-presets in the Perlin Paint Patches filter.

Change the custom input numbers and smoothness values to create different amounts and kinds of distortion. Click on the burger icon on the Custom Inputs box (below the Rad button). Select ‘Create Values Preset’ and give the new sub-preset a name.

EG. Change the values to the following:

Red Pattern width 799, Red Pattern Height, 100, Green Pattern Width, 901, Green Pattern Height, 873, Blue Pattern Width, 100. Noise/Smoothness slider in middle.

Rasterise this layer; place it above your image layer; change the layer blend mode mode to overlay; go to Filters>Colors>Emboss and set it to 5px at 50%. Now you’ve got watercolour paper texture!

Procedural Art FX 01.jpg

Procedural Art FX 02.jpg

Procedural Art FX 03.jpg

Procedural Art FX 04.jpg

Link to comment
Share on other sites

Here is another artistic filter. This produces a semi-abstract impressionistic painted effect (depending on how much displacement you use).
First, create a Procedural Texture with the following parameters and save it as a preset called Pool Ripples Displacement Map Maker.

var v=vec2(rx,ry)*(c/w); oscsin(v+(udirsc(v)*t*(a*.25)))
Cust input type    parameter       name                            Value
Z                               c                  Square Count                40
-1,1                            t                   Turbulence                   set to far right
Z                               a                  Turbulence Multiplier    6
0,1                            br                 Brightness Fader           set to far right

Now record the following as a macro:

Duplicate layer
Select 1 below current
Create new layer
Fill with foreground colour
Procedural Texture> Pool Ripples Displacement Map Maker
Select layer above
Displace 150px, Load map from layers beneath
Median Blur 35px

The above was used on an image 3250 x 2153pixels -  The Displace and Median Blur values will have a greater effect on smaller images

Save the macro as something like Semi-Abstract Painting.

Before

1021054267_abstractImpressionist1.JPG.4bc90a25aafcb1aa71aa384b9865930a.JPG

After

661601089_abstractImpressionist2.JPG.cb4690024e26bdd928c5fff7fabaa898.JPG

Link to comment
Share on other sites

Here is the next Artistic Effect using Procedural Textures. This one gives a nice Chalk Effect.

Chalk Pastel Drawing From Simple Shapes

NOTES:
My starting image dimensions were 3252 x 2155 px.
Also note that the filters used at the beginning or normal filters but the filters used in the last stage are LIVE filters (Layer menu then New Live Filter Layer) which appear clipped but need to be dragged above the image layer. I have attached an image of the layer stack.
This works best with images which have simple shapes on a plain background. You can use vector shapes and then rasterise onto a white background.

Step 1.
Select the shapes (select the background and then inverse the selection
Fill with 100% monochrome noise.
Deselect.

Step 2.
Create a softened Procedural Texture with added noise.
Create a new pixel layer below the rasterised shapes layer (Layer>New Layer.)
Fill this with the foreground ground colour (Edit>Fill with Primary Colour)
Go to Filters>Colours>Procedural Texture and select the Ripples Preset.
Set the Square count to 100 and the turbulence slider to the far right.
If you don’t have this preset, create a new one using these parameters:
var v=vec2(rx,ry)*(c/w); noisesc(v+(udirsc(v)*t))

Z         c       Square Count  100
-1,1      t       Slider to far right

Soften the texture with Filters>Blur>Gaussian Blur 5px.
Add noise with Filters>Noise>Add Noise 40%
Drag the texture layer below the image layer.

Step 3.
Displace the image layer: Go to Filters>Distort>Displace, Strength = 25 px, Load Map from Layers Beneath
Apply Blur>Median Filter 1px

Step 4.
Add a new LIVE Displace Filter through Layer>New Live Filter Layer>Distort>Displace
Drag this layer above the image layer BEFORE applying the displacement.
The effect will not work if you apply the displacement first, you must move the displace layer above the image layer and then apply the displacement.
Double-click the Displacement Map layer icon to open the controls and then displace by 350 pixels (yes, that much!)
Add a new LIVE Displace Filter through Layer>New Live Filter Layer>Blur>Gaussian Blur 0.5 px
Drag this above the Displacement map layer.
If the chalk effect is too much, double-click the Live Displacement layer icon and change the amount.

Try adding a live Median Blur set to 3px above the Live Displacement layer for a different artistic effect.

 

BEFORE

1760642803_ChalkPastelEffect1.JPG.26a69e36204e439f13d6208b3bc73c17.JPG

AFTER

1833756843_ChalkPastelEffect2.JPG.65f599caacac3640ce296f9890658ff6.JPG

LAYER STACK

1471949785_ChalkPastelEffect3.JPG.c36f606a8dd6f525a93ebfc928fcf5f9.JPG

Link to comment
Share on other sites

Love your use of PT formulae. There's been a bunch of moans of the forum about a lack of documentation of the functions therein. Do you have a reference for where to find more about these? I've heard tell that there may be info in places like GitHub and StackOverflow.

Tx

Dave Straker

Cameras: Sony A7R2, RX100V

Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11"

Favourite word: Aha. For me and for others.

Link to comment
Share on other sites

I've found it really  difficult to find any info about how PTs work. I worked out most of what I've done by tweaking existing PTs and see what happens (or doesn't!).

I plan to do a VERY basic 101 tutorial to show what I've learned. Iv'e managed to work out some very basic coding syntax used to make expressions (which I think is C++), but only some, and certainly don't understand the maths behind it. The problem we all have is that PTs are more commonly used by 3D modellers to create surface texture and shape - no good to us 2D artists!

What we all need is a step-by-step "do this, type this, then this and this happens" primer.

In the mean time, I've found one really weird maths controller called "fmod". Try this:

fmod (x/(w/a),y/(h/b))

R   a  Width Controller  13

R   b  Height Controller  4

You should get something like this.

1603661578_fmod2.JPG.e0d03d98ee36e47e533290ea33d3e7d2.JPG

Not sure what use that is, but it's interesting

Link to comment
Share on other sites

14 hours ago, RevTim said:

I've found it really  difficult to find any info about how PTs work. I worked out most of what I've done by tweaking existing PTs and see what happens (or doesn't!).

I plan to do a VERY basic 101 tutorial to show what I've learned. Iv'e managed to work out some very basic coding syntax used to make expressions (which I think is C++), but only some, and certainly don't understand the maths behind it. The problem we all have is that PTs are more commonly used by 3D modellers to create surface texture and shape - no good to us 2D artists!

What we all need is a step-by-step "do this, type this, then this and this happens" primer.

In the mean time, I've found one really weird maths controller called "fmod". Try this:

fmod (x/(w/a),y/(h/b))

R   a  Width Controller  13

R   b  Height Controller  4

...

Not sure what use that is, but it's interesting

I think this is as follows:

  • In maths, 'modulus' is the same as 'remainder'.
  • In programming, this is often abbreviated to 'mod'. Other versions here.
  • The C++ version of fmod is here. I think Affinity uses this.
  • In brief, fmod(a,b) divides a by b and returns the decimal (floating point) remainder, so fmod(7.5,5) is 2.5

In the usage above, fmod (x/(w/a),y/(h/b) is presumably assigned to R, G and B, and:

  • x and y are the number of pixels from the left and top
  • w and h are the width and height of the viewport in pixels
  • a is set as 13 and b as 4
  • For convenience, assume w=1300 and h=1000
  • So w/a=100 and h/b=250
  • Now formula is fmod(x/100,y/250)
  • Take one row, say y=250. Now we have fmod(0.01*x,1)
  • When x is less than 100, the result goes from 0 to 1, giving black to white, which is the left border
  • When x is 101, the result is 1.01, which is clamped to 0..1 for display and so appears white. This repeats until x=199, giving the white band.
  • When x gets to 200, the remainder now returns to zero, so we return to the gradient.
  • As y gets larger, the white band get wider.
  • And so on.

Dave Straker

Cameras: Sony A7R2, RX100V

Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11"

Favourite word: Aha. For me and for others.

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...
 Share

×
×
  • Create New...

Important Information

Please note there is currently a delay in replying to some post. See pinned thread in the Questions forum. 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.