I did try to port this routine to a new gmic filter
Alas till now no much success
in case somebody may help to spot the error here the code till now
(btw for sure a error is in the very first line , here " -if {$1==0} -blur_xy (w/$2),(h/$3)"
but i cannot see why is wrong: w and h should be image Height and Width, $2 and $3 the new W and H, (w/$2) and(h/$3) should be positive because the filter is to downscale
#@gimp Scale Down Neat : gimp_scaledown,gimp_scaledown_preview(1)
#@gimp : sep = separator()
#@gimp : note = note ("To scale down preserving clean edges and smoothly sharpen")
#@gimp : sep = separator()
#@gimp : Scale down to = choice(" New Width and Height ","preserve_image_ratio Set new Width ","preserve_image_ratio Set new Height",)
#@gimp : New Width = float(2400,20,4800)
#@gimp : New Height = float(1800,20,3600)
#@gimp : sep = separator()
#@gimp : sep = separator()
#@gimp : Skip Post Sharpening = bool(false)
#@gimp : sep = separator()
#@gimp : note = note( "Skip Post Sharpening": if chosen will deactivate all controls below )
#@gimp : sep = separator()
#@gimp : Spatial radius = float(1.25,0,20)
#@gimp : Bilateral radius = float(30,0,60)
#@gimp : Amount = float(2.3,0,10)
#@gimp : Darkness level = float(1,0,4)
#@gimp : Lightness level = float(0.2,0,4)
#@gimp : Channel(s) = choice("All","Lightness","Value")
#@gimp : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical")
#@gimp : note = note{"\n\n<small><b>Note : </b>
#@gimp : This filter is inspired by a discussion on
www.gimpchat.com #@gimp : </small>"}
#@gimp : sep = separator(), note = note("<small>Author : <i>Photocomix;</i>. Latest update : <i>2012/9/20</i>.</small>")
gimp_scaledown :
-if {$1==0} -blur_xy (w/$2),(h/$3)
-elif {$1==1} -blur_xy(w/$2),(w/$2)
-elif {$1==2} -blur_xy(h/$3),(w/$2)
-endif
-if {$1==0}
-resize $2,$3,2
-elif {$1==1}
-resize2dx $2,2
-elif {$1==2}
-resize2dy $3,2
-endif
-if {$4==1}
-gimp_unsharp 0,$5,$6,$7,$8,$9,$10
-endif
gimp_scaledown_preview :
-gimp_split_preview "-gimp_scaledown ${1--2}",$-1