That reverse ordering is a relatively-recent bug that I found when trying to make a different filter. GIMP and G’MIC don’t always play nicely and the former annoyingly feeds the latter everything in the reverse order. Besides that, I’ve updated the filter again to fix more problems with images that have alpha channels:
#@gui Layer cake : fx_layer_cake, fx_layer_cake_preview(1)
#@gui : Iterations = int(4,1,32)
#@gui : Angle = float(360,-1440,1440)
#@gui : Angle times iteration = bool(0)
#@gui : Size = float(75,0,200)
#@gui : Centre = point(50,50,0,1,255,255,255,175)
#@gui : Boundary = choice(3,"None","Nearest","Periodic","Mirror")
#@gui : Blur = float(0,0,100)
#@gui : sep = separator()
#@gui : Anti-alias amplitude = float(30,0,100)
#@gui : Edge threshold (%) = float(0,0,100)
#@gui : Smoothness = float(3,0,10)
#@gui : Output layers = choice("Off","On","Hollow")
#@gui : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical","Duplicate top","Duplicate left","Duplicate bottom","Duplicate right","Duplicate horizontal","Duplicate vertical","Checkered","Checkered inverse"), Preview split = point(50,50,0,0,200,200,200,0,10,0)
blend_alpha_lc :
f "opacity=max(1,j(#1,0,0,0,3)*2/255);[i0*(1-opacity)+j(#1,0,0,0,0)*opacity,i1*(1-opacity)+j(#1,0,0,0,1)*opacity,i2*(1-opacity)+j(#1,0,0,0,2)*opacity,max(0,min(255,i3+j(#1,0,0,0,3)))]" rm[1]
fx_layer_cake :
repeat $! l[$>]
iter=$1
angle=$2
if $3 angle*=$iter fi
size=$4/2
to_rgba
repeat $iter
[0] rotate[-1] {$angle/$iter*($>+1)},1,$7,$5%,$6%
100%,100%,1,4 ellipse. $5%,$6%,{$size/$iter*($iter-$>)}%,{$size/$iter*($iter-$>)}%,0,1,255
if {$12!=1} ellipse. $5%,$6%,{$size/$iter*($iter-1-$>)}%,{$size/$iter*($iter-1-$>)}%,0,1,0 fi
blur. {$8/$iter}
#display
fx_smooth_antialias. ${9-11}
f. "[255,255,255,i3]"
f.. "i*i(#-1)/255" rm[-1]
if {$!>=3}
l[-1,-2]
if {!$12} blend_alpha_lc fi
endl fi done
l[0]
100%,100%,1,4 fc. 255,255,255,255 if {$12!=1} ellipse. $5%,$6%,{$size}%,{$size}%,0,1,0 fi
blur. {$8/$iter}
fx_smooth_antialias. ${9-11}
f.. "i*i(#-1)/255" rm[-1]
endl
if {!$12} blend_alpha_lc fi
endl done
fx_layer_cake_preview:
if {!$12} gui_split_preview "fx_layer_cake $*",${-3--1} else fx_layer_cake $* fi