Just caught this.
Could you write the full command names or a least annotate for the benefit of the non-G’MIC script writers?
#@gui Bomb blend : fx_blend_bomb, fx_blend_bomb_preview()
#@gui : note = note("Creates a random transfer function 'mesh' and then blends images accordingly. Based on method shown <a href="https://discuss.pixls.us/t/im-generating-new-blending-modes-for-krita/8104/16">on discuss.pixls.us</a>.")
#@gui : Recompute = button(0)
#@gui : Mesh X = int(16,1,256)
#@gui : Mesh Y = int(16,1,256)
#@gui : Mesh smoothness = float(0.5,0,10)
#@gui : Mesh contrast = float(50,0,100)
#@gui : Reverse = bool(0)
#@gui : Alpha = bool(0)
#@gui : Normalise = bool(0)
fx_blend_bomb :
# select the first two images in the list and convert them to rgba
local[0,1] to_rgba
# create transfer function mesh image and apply noise
# if we're using the alpha channel, apply noise in alpha channel too
$2,$3,1,4 noise[-1] 255
if $7 apply_channels[-1] "noise 255",rgba_a endif
# resize mesh using nearest-neighbour interpolation and blend to smooth it out
resize[-1] 256,256 normalize[-1] 0,255 blur[-1] {$4^2}%
# clip values to add contrast to mesh
cut[-1] {($5-1/255)/2}%,{100-($5-1/255)/2}% normalize[-1] 0,255
# delete the alpha channels of all images if we're not using them
if {!$7} to_rgb endif
# reverse blending images if we choose to
if $6 reverse[0,1] endif
# select colour to fill each pixel with from transfer function mesh image to fill result image with
# use x-coordinate from value of bottom image, y-coordinate from value of top image, channels are independent
fill[-3] "i(#2,i(#0),i(#1))"
# remove matrix and second image
remove[1,2]
# a final normalisation
if $8 apply_channels "normalize 0,255",rgba endif
# deselect
endlocal
fx_blend_bomb_preview :
fx_blend_bomb $*
It’s still got some way to go (you’ll notice that I’ve already added another normalize
). I have to sort out multiple layer inputs like G’MIC’s standard blend filter already has.