Skip to content

Commit

Permalink
Filter 'Illustration Look': Add a 'Strength' slider.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtschump committed Sep 26, 2023
1 parent 4074a5f commit 1cf2306
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions include/david_tschumperle.gmic
Expand Up @@ -47,36 +47,43 @@ median_color :
#---------------------

#@gui Illustration Look : fx_illustration_look,fx_illustration_look_preview(0)
#@gui : Strength (%) = float(100,0,100)
#@gui : Tone Mapping (%) = float(100,0,100)
#@gui : Desaturate (%) = float(0,0,100)
#@gui : Vintage Tone (%) = float(0,0,100)
#@gui : Output as Multiple Layers = bool(0)
#@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")
#@gui : sep = separator(), note = note("<small>Authors: <i>Sébastien Guyader</i> and <i>David Tschumperlé</i>. Latest update: <i>2017/05/01</i>.</small>")
fx_illustration_look :
repeat $! l[$>] nm=${-gui_layer_name}
foreach {
nm=${-gui_layer_name}
to_rgb => base_layer

# Create processed layers.
+fx_smooth_anisotropic[base_layer] 20,0.16,0.63,0.6,2.35,0.8,30,2,0,1,1,0,1,24 => blur_layer
+blend[base_layer,blur_layer] grainextract => detail_layer
if $2 rgb2hsv[blur_layer] sh[blur_layer] 1 -. {$2%} c. 0,1 rm. hsv2rgb[blur_layer] fi
if $3 +fx_mix_rgb[blur_layer] 1,10,0,1,0,0,0.7,-10,0,0,10,0 j[blur_layer] .,0,0,0,0,{$3%} rm. fi
if $1 +fx_map_tones_fast[blur_layer] 20,0.2,11,0 j[blur_layer] .,0,0,0,0,{$1%} rm. fi
if $3 rgb2hsv[blur_layer] sh[blur_layer] 1 -. {$3%} c. 0,1 rm. hsv2rgb[blur_layer] fi
if $4 +fx_mix_rgb[blur_layer] 1,10,0,1,0,0,0.7,-10,0,0,10,0 j[blur_layer] .,0,0,0,0,{$4%} rm. fi
if $2 +fx_map_tones_fast[blur_layer] 20,0.2,11,0 j[blur_layer] .,0,0,0,0,{$2%} rm. fi
simplelocalcontrast_p[blur_layer] 25,1,50,1,1,1,1,1,1,1,1,1
+fx_graphic_novelfxl[blur_layer] 1,2,6,5,20,0,1.02857,200,0,1,0.0761905,0.0857143,0,0,0,2,1,1,1,1.25714,0.371429,1.04762 => graphicnovel_layer

# Order and set layer properties.
mv[detail_layer] 0 =>[detail_layer] "name("$nm" [Detail]),mode(grainmerge),opacity(100)"
mv[graphicnovel_layer] 1 =>[graphicnovel_layer] "name("$nm" [Paint]),mode(normal),opacity(50)"
mv[blur_layer] 2 =>[blur_layer] "name("$nm" [Base]),mode(normal),opacity(100)"
rm[base_layer]

if !$4 gui_merge_layers => "name("$nm"),mode(normal),opacity(100)" fi
done done
if $1<100
mv[base_layer] 0 =>[base_layer] "name("$nm" [Original]),mode(normal),opacity("{round(100-$1)}")"
else
rm[base_layer]
fi
if !$5
gui_merge_layers => "name("$nm"),mode(normal),opacity(100)"
fi
}

fx_illustration_look_preview :
gui_split_preview "fx_illustration_look ${1-3},0",$-1
gui_split_preview "fx_illustration_look ${1-4},0",$-1

#@gui _<b>Colors</b>
#---------------------
Expand Down

0 comments on commit 1cf2306

Please sign in to comment.