Heightfield Warp command-line

I don’t have a G’MIC GUI to copy the default parameters to the clipboard, for the Heightfield Warp filter.
Can somebody help in that regard and paste what you see as the default params from the GUI here? That could help immensely!

Thanks!

G’MIC command:
fx_heightfield_warp 1,“0.25cos(3pix)sin(3piy)”,100,0,1,1.5,nan,nan,50,20,20,40,30,20,1,“50,50”,50,50,75,50

From file update376.gmic:

#@gui Heightfield Warp:fx_heightfield_warp,fx_heightfield_warp_preview
#@gui :=note("Description: Apply a geometric warp by projecting the image onto a 3D heightfield surface. ")
#@gui :
=separator()
#@gui :=note(“Heighfield Geometry:”)
#@gui :Type=choice(1,“Custom”,“Sphere”,"Cylinder)
#@gui :Custom Heighfield=text{“0.25cos(3pix)sin(3piy)”}
#@gui :Factor ()=float(100,-500,500) #@gui :Smoothnness ()=float(0,0,10)
#@gui :
=separator()
#@gui :_=note(“3D Parameters:”)
#@gui :Align Camera Center=bool(1)
#@gui :Focale=float(1.5,0.5,10)
#@gui :Light On/Off=point(80,20,-1,1,255,255,0,128,2%)
#@gui :Ambient Light ()=float(50,0,100)_1 #@gui :Diffuse Shadows ()=float(20,0,100)_1
#@gui :Diffuse Highlights ()=float(20,0,100)_1 #@gui :Specular Light ()=float(40,0,200)1
#@gui :Specular Material=float(30,1,100)1
#@gui :
=separator()
#@gui :Preview Grid Overlay (%)=float(20,0,100)
#@gui :Preview Resolution=choice(1,“Full”,“Mid”,“Low”)
#@gui :
=value(50,50)
#@gui :Center=point(50,50,0,1,255,128,32,255,12)_0
#@gui :Size / Angle=point(75,50,0,1,255,64,0,255,8)_0

1 Like

Thanks!
So, it’s as I suspected, I kept getting the following error:

[gmic] *** Error in ./fx_heightfield_warp/ *** Operator '=' on variables 'heightfield_type,heightfield_formula,heightfield_factor,heightfield_smoothn(...)': Right-hand side '1,0.25*cos(3*pi*x)*sin(3*pi*y),100,0,1,1.5,80,20,50,20,20,40,30,20,15,50,50(...)' defines only 20 values for 21 variables.

But in the update376.gmic file it has: heightfield_type,heightfield_formula,heightfield_factor,heightfield_smoothness,align_camera_center,focale,light_x,light_y,ambient_light,diffuse_shadows,diffuse_highlights,specular_light,specular_material,preview_grid_overlay,preview_resolution,ocenter_x,ocenter_y,center_x,center_y,size_x,size_y=$1,"$2",${3-20}

The filter was only passing 20 of 21 parameters because of a wrong range (${3-20})
Updating it to ${3-21} made it pass everything correctly.

i.e.:

root@localhost:/storage/emulated/0/Documents/tomato# gmic input-01.png fx_heightfield_warp 1,"0.25*cos(3*pix)*sin(3*piy)",100,0,1,1.5,nan,nan,50,20,20,40,30,20,1,50,50,50,50,75,50 o out-01.png
[gmic]./ Start G'MIC interpreter (v.3.7.6).
[gmic]./ Input file 'input-01.png' at position 0 (1 image 500x500x1x1).
[gmic]./ Output image [0] as a png file 'out-01.png' (1 image 250x250x1x1).
[gmic]./ End G'MIC interpreter.