Try changing the wavelength and radius to something real high and change clamp mode to mirror
Code
Configuration.AddSlider("phase", "Phase", "", 0, 100, 0);
Configuration.AddSlider("radius", "Radius", "", 1, 1000, 250);
Configuration.AddSlider("wavelength", "Wavelength", "", 1, 1000, 16);
Configuration.AddSlider("amplitude", "amplitude", "", 1, 100, 5);
Configuration.AddSlider("centerX", "centerX", "", 0, 100, 50);
Configuration.AddSlider("centerY", "centerY", "", 0, 100, 50);
Configuration.Add1ofNPicker("wrap", "Clamp Type", "", ["Clamp", "Mirror"], 0);
Execution
// Joel Besada
// https://github.com/JoelBesada/JSManipulate
// Plus PAEz touch here and there
function getBilerpixel(l, x, y, w, h) {
var corner = [];
var xi, yi, xip, xip1;
var yip, yip1;
xi = ~~x;
yi = ~~y;
xip = Math.max(Math.min(xi, w - 1), 0);
xip1 = Math.max(Math.min(xi + 1, w - 1), 0);
yip1 = Math.max(Math.min(yi + 1, h - 1), 0);
yip = Math.max(Math.min(yi, h - 1), 0);
corner[0] = l.GetPixel(xip, yip, 0, 0); //this.layers[l].data32[xip + yip];
corner[1] = l.GetPixel(xip1, yip, 0, 0); //this.layers[l].data32[xip1 + yip];
corner[2] = l.GetPixel(xip, yip1, 0, 0); //this.layers[l].data32[xip + yip1];
corner[3] = l.GetPixel(xip1, yip1, 0, 0); //this.layers[l].data32[xip1 + yip1];
return cosineInterpolate(corner, (x - xi), (y - yi));
}
function cosineInterpolate(v, x, y) {
var f1, f2, mf1, mf2, g0, g1, g2, g3;
var color, r, g, b;
mf1 = (1 - Math.cos(x * Math.PI)) * 0.5;
mf2 = (1 - Math.cos(y * Math.PI)) * 0.5;
var f1 = 1 - mf1;
var f2 = 1 - mf2;
var g0 = f1 * f2;
var g1 = mf1 * f2;
var g2 = f1 * mf2;
var g3 = mf1 * mf2;
color = ((v[0] & 255) * g0 + (v[1] & 255) * g1 + (v[2] & 255) * g2 + (v[3] & 255) * g3);
color = color | ((((v[0] >> 8 & 255) * g0 + (v[1] >> 8 & 255) * g1 + (v[2] >> 8 & 255) * g2 + (v[3] >> 8 & 255) * g3) & 255) << 8);
color = color | ((((v[0] >> 16 & 255) * g0 + (v[1] >> 16 & 255) * g1 + (v[2] >> 16 & 255) * g2 + (v[3] >> 16 & 255) * g3) & 255) << 16);
color = color | ((((v[0] >> 24 & 255) * g0 + (v[1] >> 24 & 255) * g1 + (v[2] >> 24 & 255) * g2 + (v[3] >> 24 & 255) * g3) & 255) << 24);
return color;
}
// Clamps
// 0 - clamp
// 1 - mirror
transformFilter = function(inputData, outputData, transformInverse, width, height, clamp) {
var out = [];
for (var y = 0; y < height; y++) {
for (var x = 0; x < width; x++) {
transformInverse.apply(this, [x, y, out]);
var srcX = out[0];
var srcY = out[1];
var w = width - 2;
var h = height - 2;
if (clamp==0){
if (srcX<0) srcX=0;
else if (srcX>w) srcX=w;
if (srcY<0) srcY=0;
else if (srcY>w) srcY=w;
} else if (clamp==1) {
var direction = 1;
while (srcX < 0 || srcX > w) {
if (srcX > w) {
srcX = w - (srcX - w);
direction = -1;
}
if (srcX < 0) {
srcX *= -1;
direction = 1;
}
}
while (srcY < 0 || srcY > h) {
if (srcY > h) {
srcY = h - (srcY - h);
direction = -1;
}
if (srcY < 0) {
srcY *= -1;
direction = 1;
}
}
}
//var srcX2=srcX+direction;
//var srcY2=srcY+direction;
var rgba = getBilerpixel(inputData, srcX, srcY, width - 1, height - 1);
outputData.SetPixel(x, y, 0, 0, rgba);
}
}
}
mod = function(a, b) {
var n = parseInt(a / b);
a -= n * b;
if (a < 0) {
return a + b;
}
return a;
}
triangle = function(x) {
var r = this.mod(x, 1);
return 2 * (r < 0.5 ? r : 1 - r);
}
filter = function(phase, radius, wavelength, amplitude, centerX, centerY, wrap) {
var input = Document.RasterImage;
var width = input.sizeX;
var height = input.sizeY;
var clone;
clone = Document.Duplicate();
clone = clone.RasterImage;
var radius2 = radius*radius;
var iCenterX = width * centerX; var iCenterY = height * centerY;
var transInverse = function(x,y,out){
var dx = x-iCenterX;
var dy = y-iCenterY;
var distance2 = dx*dx + dy*dy;
if(distance2 > radius2){
out[0] = x;
out[1] = y;
} else {
var distance = Math.sqrt(distance2);
var amount = amplitude * Math.sin(distance/wavelength * Math.PI * 2 - phase);
amount *= (radius-distance)/radius;
if(distance != 0){
amount *= wavelength/distance;
}
out[0] = x + dx*amount;
out[1] = y + dy*amount;
}
}
transformFilter(clone, input, transInverse, width, height, wrap);
}
var phase = Configuration.phase;
var radius = Configuration.radius;
var wavelength = Configuration.wavelength;
var amplitude = Configuration.amplitude;
var centerX = Configuration.centerX/100;
var centerY = Configuration.centerY/100;
var wrap = Configuration.wrap;
filter(phase, radius, wavelength, amplitude, centerX, centerY, wrap);