New filter 'Deformations / Breaks'

Just to let you know I’ve added a new filter in the G’MIC plug-in, named Deformations / Breaks.


#@gui Breaks : fx_breaks,fx_breaks(0)
#@gui : Amplitude = float(30,0,300)
#@gui : Frequency (%) = float(30,0,100)
#@gui : Smoothness = float(0.5,0,10)
#@gui : Boundary = choice(3,"Transparent","Nearest","Periodic","Mirror")
#@gui : sep = separator()
#@gui : note = note("<small>Author: <i>David Tschumperlé</i>.      Latest Update: <i>2021/09/07</i>.</small>")
fx_breaks :
  repeat $! l[$>]
    if !$4 to_a fi
    100%,100%,1,1,"u<($2%)^6" distance. 1 sharpen. 100000 neq. 0 distance. 1 b. $3 g. xy a[-2,-1] c
    n. -$1,$1 warp[0] .,1,1,$4 rm.
  endl done

Hello David, funny effects! Just wondering, why is mirror called mirror, as it doesn’t seem to mirror anything.

It does mirror the pixels located near the image borders.
Maybe in your image, pixels at the borders are already black ?

Exact! There’s a black border around my favorite pin-up…


1 Like

When an operation makes each output pixel from a number of surrounding input pixels, we need special processing near the boundary of the output because some “surrounding” pixels won’t be inside the input image. So we pretend that the input image extends to infinity in both directions. “Boundary=mirror” pretends that the input image is mirrored at each boundary.

EDIT: So we can imagine that the input image is surrounded by eight copies of itself, each copy being reversed horizontally or vertically or both, as if reflected by four mirrors.