Deep blue sky effect

Wrote the G’MIC GIMP filter for this effect. It should be able to accept both 8 and 16-bit layers. This is my first time making a filter, so let me know if everything is okay.


Version 3

#@gui Darken Sky : fx_darken_sky, fx_darken_sky_preview(1)
#@gui : Strength = float(.75,0,1)
#@gui : Contrast = float(5,0,5)
#@gui : Blend mode = choice(0,"Overlay","Softlight")
#@gui : sep = separator(), Normalize = bool(1)
#@gui : Brighten = float(0,0,1)
#@gui : sep = separator(), Preview type = choice(5,"Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical","Duplicate top","Duplicate left","Duplicate bottom","Duplicate right")
#@gui : sep = separator(), note = note("Based on <i>Carmelo_DrRaw</i>'s tutorial:\n    https://discuss.pixls.us/t/deep-blue-sky-effect/4506\n\nFilter by <i>afre</i>. Latest update: <i>2017-07-01</i>.")
fx_darken_sky :
  mode=${-arg\ 1+$3,overlay,softlight}
  -repeat $! -l[$>] -split_opacity -l[0]
    -if {iM>255} -/ 257 bit=1 -endif
    --l
      -s c -rm.. -remove_hotpixels.. 5 -guided.. .,1,{.01*255^2}
      -- -- {im} -min 128 -- 128 -* {(5+$2)/10} -+ 128
    -endl
    -blend $mode,$1
    -if $4 -n 0,255 -endif
    -apply_curve 1,0,0,{ia},{ia+(sqrt(iv)*$5/2)},255,255
    -if $bit -* 257 -endif
  -endl -a c -endl -done

fx_darken_sky_preview :
  -gui_split_preview "-fx_darken_sky $*",$-1

Version 1

#@gui Darken sky : fx_darken_sky, fx_darken_sky_preview(1)
#@gui : Strength = float(0.75,0,1)
#@gui : Scale = float(50,0,100)
#@gui : sep = separator(), Normalize = bool(1)
#@gui : Brighten = float(0,0,2)
#@gui : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical","Duplicate top","Duplicate left","Duplicate bottom","Duplicate right")
#@gui : sep = separator(), note = note("<small>Based on <i>Carmelo_DrRaw</i>'s tutorial:\n    https://discuss.pixls.us/t/deep-blue-sky-effect/4506\n\nFilter by <i>afre</i>. Latest update: <i>2017-06-25</i>.</small>")
fx_darken_sky :
  -repeat $! -l[$>] -split_opacity -l[0]
    -if {iM>255} -/ 257 bit=1 -endif
    .x1
    -l.
      -s c -rm.. -- -+ 128 -min 128 -adjust_colors 0,-{$2}
    -endl
    -blend overlay,$1
    -if $3 -n 0,255 -endif
    -apply_curve 1,0,0,64,{64+(sqrt(iv)*$4)},255,255
    -if $bit -* 257 -endif
  -endl -a c -endl -done

fx_darken_sky_preview :
  -gui_split_preview "-fx_darken_sky $*",$-1