# Mapping Resources > How Do I ??? >  PS Glass Distort filter for Gimp?

## Gidde

> (the Distort - Glass filter on the river gives it away but I don't know if GIMP has something similar or not)


It does not, much to my dismay. I've been experimenting for days trying to find something in GIMP that will even approximately reproduce the effect.

----------


## RobA

> It does not, much to my dismay. I've been experimenting for days trying to find something in GIMP that will even approximately reproduce the effect.


I have this in my notes from way back....

    * Duplicate your layer, run a Sobel edge-detect on the duplicate, and then add a touch of Gaussian blur.
    * Create a new white layer (Xoffset) and Bump Map it against the duplicate with darkness compensation disabled, an Azimuth of "0", and an elevation of about "30".
    * Create a new white layer (Yoffset) and do a Bump Map against the duplicate with darkness compensation disabled, an Azimuth of "270", and an elevation of about "30".
    * Perform a Displacement Map on the original layer, using the Xoffset and Yoffset layers as the corresponding displacement maps and adjusting the amount of displace to suit.

Can someone with PS and Gimp compare, and if it works I can script it up, OK?

-Rob A>

----------


## Gidde

Hmm. I just tried this, and with a noisy ocean layer the sobel edge-detect gives me a completely transparent layer; dead in the water. Then I tried it with a black and white land-mask type image, and got very little distortion (even with displace values > 100). It looks like the distortion it does give is on the right track though. Could be that it needs something more defined than solid-noise colored clouds (with light coastal area - same as I started with for my glass-ified ocean in my last map) and less defined than black/white stark image. I'll keep playing with it.

// Edit: Here are some comparison images in case they help. The blue image is just original and photoshop versions. The B/W is following the instructions you gave with a 200 displace.

----------


## RobA

> Hmm. I just tried this, and with a noisy ocean layer the sobel edge-detect gives me a completely transparent layer; dead in the water. Then I tried it with a black and white land-mask type image, and got very little distortion (even with displace values > 100). It looks like the distortion it does give is on the right track though. Could be that it needs something more defined than solid-noise colored clouds (with light coastal area - same as I started with for my glass-ified ocean in my last map) and less defined than black/white stark image. I'll keep playing with it.
> 
> // Edit: Here are some comparison images in case they help. The blue image is just original and photoshop versions. The B/W is following the instructions you gave with a 200 displace.


Playing a bit more.

I tried Filter->Edge Detect->Edge (Sobel, value 10)  *(Not Filter-->Edge Detect->Sobel)*
Gaussian blur 5
Duplicate  the blurred layer.
Filter->Distort->Emboss (emboss, 0,30,30) on one (used as X displacement)
Filter->Distort->Emboss (emboss, 270,30,30) on the other (used as Y displacement)
Filter->Map->Dispace (20,20, edges smear)

The blur changes the size of the ripples and the displace amount controls the sharpness?

Here is the result:



-Rob A>

----------


## RobA

I moved these posts to the how-to? forum...

-Rob A>

----------


## Jaxilon

Look great RobA.

----------


## hohum

Here is what I got:



You need to run Filters>Edge Detect>Edge with a sobel setting. Then the displacement map with setting of 50 for both. If you do Filters>Edge Detect>Sobel you get a transparent layer.

This is with lighting effects with a Yoffset layer bump mapped.


And then the two combined with the light effects layer at 25% opacity.


Not perfect, but perhaps on the right track. I had tried a beaten metal effect with felimage galvanized noise and lighting effects that also did something similar.

----------


## RobA

It looks like sobel of the source is just an option (ripples will be harsher where there are larger transitions, and the ripples parallel the transients).

Here is the same, but starting with a high turbulence plasma cloud that was blurred 3px sobel edge detected, plurred 3 px again, then the rest of the steps followed (displace of 10 in the last step):



-Rob A>

----------


## hohum

I'm just stealing you guys's stuff to see it side by side.

Gidde's:                                RobA's:
 

Pretty darn close. Perhaps just a little more blur to the final image and they would be identical.

----------


## Gidde

Good call on the move! We had totally hijacked that poor thread  :Wink: 




> I tried Filter->Edge Detect->Edge (Sobel, value 10)  *(Not Filter-->Edge Detect->Sobel)*


Aha! That was my problem. 

Thanks for helping test this out, Hohum, your test looks absolutely fantastic. In fact, the difference between yours and mine looks almost exactly like the differences if you play with the settings in the PS filter.

I can't wait to try this on my current WIP. Rob, you are, as ever, my hero.

----------


## RobA

Try this script and play with the sliders.

-Rob A>

----------


## Ascension

I'm so glad that I just have to click one button and move some sliders in PS instead of all of this   :Smile:

----------


## hohum

Sweet script RobA. Here is what I got with settings of Ripple Size:2, Ripple Spread: 20, Ripple Intensity: 60.


I noticed some artifacts along the edges. I think it occurs in the sobel edge detect step.

----------


## Ascension

That sort of thing happens to me in PS when using displacement maps.

----------


## Seretur

Awesome!  Time to add another script to your signature.   :Smile:

----------


## Gidde

That edge stuff happens in PS, too, don't worry about it Rob.

----------


## RobA

> Sweet script RobA. Here is what I got with settings of Ripple Size:2, Ripple Spread: 20, Ripple Intensity: 60.


It was a bug in the displace filter function call documentation (I've submitted a bug report).  This version should work now:
water-ripple.zip

EDIT: Updated one again to allow plasma, cloud noise, or source image edge rippling, plus an option to keep the original layer, and create the ripple layer as "new".

-Rob A>

----------


## hohum

That's the ticket, worked like a charm.



Thanks RobA. I'm still going to try and tackle a few script fu's just because I want to understand the code, but this script rocks.

[EDIT- I think that this image was with v.2 of the script, I just downloaded v.3]

----------

