- two options "Light Mean Curvature" and "Simple Smooth" in the "Simplification" parameter,
- an option "Soft Rainbow" in the "Flat Color Effect" parameter.
Here are some examples with "Simple Smooth", "Details = 1", "Soft Rainbow", "Line Antialias = 100" and "Final Antialias = Double":
#@gui Comicbook test: test_comic, test_comic_preview(0)
#@gui : note = note("<b>Note</b>: Photo to cartoon")
#@gui : sep = separator()
#@gui : note = note(" ")
#@gui : Simplification = choice(0, "None", "Light", "Light Antialias", "Strong Antialias", "Median", "Iuwt", "Thin Brush", "Light Mean Curvature", "Mean Curvature", "Simple Smooth")
#@gui : sep = separator()
#@gui : note = note("<b>For edges:</b>")
#@gui : Flattening for Edge (bilateral) = int(2,0,5)
#@gui : Edge Method = choice(0, "Diff. of Gauss.", "Diff. of BoxBlur", "Diff. of Median")
#@gui : Edge Desaturation Method = choice(1, "Lightness", "MaxRGB", "MinRGB")
#@gui : Details = int(41,1,50)
#@gui : Line Thickness = float(1,0.5,4)
#@gui : Line Strength = float(15,0,19)
#@gui : Line Antialias = int(15,0,100)
#@gui : sep = separator()
#@gui : Add Colors = bool(1)
#@gui : note = note("<b>For colors:</b>")
#@gui : Luminosity Increase = int(10,0,50)
#@gui : Saturation Increase = int(20,0,50)
#@gui : Final Flattening (bilateral) = int(6,0,10)
#@gui : Color Effect = choice(2, "None", "Deep Black", "Local Contrast Enhancement", "Colorful")
#@gui : Flat Color Effect = choice(0, "None", "Soft Rainbow", "Rainbow", "Hard Rainbow", "Posterize Softly", "Super Flat")
#@gui : Colors to Black or White = choice(0, "No", "Soft Threshold", "Threshold with Soft Antialias", "Lines and Black")
#@gui : sep = separator()
#@gui : Relief Effect = choice(0, "None", "Groove", "Bump")
#@gui : Special Effect = choice(0, "None", "Dream", "Past", "Sketch of Future")
#@gui : sep = separator()
#@gui : Final Antialias = choice(0, "None", "Simple", "Double")
#@gui : sep = separator()
#@gui : Preview Type = choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal",
#@gui : "Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right",
#@gui : "Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse")
#@gui : Preview Split = point(50,50,0,0,200,200,200,0,10)
#@gui : sep = separator()
#@gui : url = link("Filter discussed here","http://gimpchat.com/viewtopic.php?f=11&t=19335&p=266517#p266512")
#@gui : note = note("<small>Author: <i>Claude Lion</i>. Latest Update: <i>2024/02/25</i>.</small>")
#@gui : note = note("<small>It uses filters of David Tschumperlé and a few filters of Jérôme Boulanger.</small>")
test_comic :
foreach {
simplif=$1
nbBilatBord=$2
methBord=$3
methDesat=$4
details=$5
lineThick=$6
forceTrait=$7
antialias=$8
addColors=$9
augmLum=$10
augmSat=$11
nbBilatFin=$12
colorEffect=$13
flatColorEffect=$14
bw=$15
reliefEffect=$16
specialEffect=$17
finalAntialias=$18
if $simplif==2
fx_smooth_antialias. 100,0,2.5,0,50,50
elif $simplif==3
fx_smooth_antialias. 100,0,5,0,50,50
elif $simplif==4
fx_smooth_median. 3,255,0,0,50,50
elif $simplif==5
jeje_denoise_iuwt. 3,4,2,0
jeje_denoise_iuwt. 3,4,2,0
elif $simplif==6
fx_smooth_anisotropic. 60,0.9,0.64,3.1,1.1,0.8,30,2,0,1,1,0,0,24
elif $simplif==7
meancurvature_flow. 1
elif $simplif==8
meancurvature_flow. 20
elif $simplif==9
smooth. 100,0.2,1,0,0
fi
curv="0,0,"{50-$augmLum}","{50+$augmLum}",100,100,-1,0,0,"{50-$augmSat}","{50+$augmSat}",100,100,-1,0,0,100,100,-1,0,0,100,100,-1"
+fx_curves_interactive. 7,0,1,"7",$curv
fx_smooth_nlmeans.. 4,4,{51-$details},5,0,0,24,0
fx_smooth_bilateral.. 10,7,$nbBilatBord,0,0
+cut.. 0,255
reverse[-2,-1]
if $methBord==0
blur[-3] {$lineThick}
#ac[-3] "blur "{$lineThick},ryb
elif $methBord==1
boxfilter[-3] xy,{$lineThick+0.01}
elif $methBord==2
median[-3] {($lineThick+0.01)*2}
fi
sub[-3,-2]
if $methDesat==0
fill.. "m = min(R,G,B); M = max(R,G,B); L = 0.5*(m + M); [L, L, L]"
elif $methDesat==1
fill.. "M = max(R,G,B); [M, M, M]"
elif $methDesat==2
fill.. "M = min(R,G,B); [M, M, M]"
fi
cut.. 0,255 n.. 0,255
negate..
threshold.. {$forceTrait+80}%
n.. 0,255
if $simplif>0
fx_smooth_antialias.. 100,0,2.5,0,50,50
fx_curves_interactive.. 7,0,1,"7","0,0,69,0,70,100,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1"
fi
fx_smooth_antialias.. $antialias,0,1,0,50,50
if $addColors==1
mul[-2,-1]
n. 0,255
fx_smooth_bilateral. 10,7,$nbBilatFin,0,0
if $colorEffect==1
fx_custom_transform. "i","if(i<64,0, sqrt((i-64)/(256-64))*256 )","i","i","i","i",0
elif $colorEffect==2
fx_LCE. 80,0.5,1,1,0,0
elif $colorEffect==3
remove_opacity.
rgb2hsv. split. c nm. val nm.. sat nm... hue
+mul[val] [sat] nm. ref
sqrt[ref]
+sub[ref] 1 nm. subRef
sub[val] 1 *[val] [subRef] negate[val]
sub[sat] 1 *[sat] [subRef] negate[sat]
rm[ref] rm[subRef]
append[-3--1] c
hsv2rgb.
#n. 0,255
fi
if $flatColorEffect==1
input 360,1,1,1,x nm. hue
input 360,1,1,1,1 nm. sat
input 360,1,1,1,1 nm. val
append[-3--1] c
hsv2rgb.
point. 0,0,0,1,0
point. 359,0,0,1,255
+index[-2] [-1],0,1
rm.. rm..
fx_smooth_antialias. 15,0,1,0,50,50
elif $flatColorEffect==2
(255,0,0,0,0,0,0,0,0,0,0,64,128,192,255,255,255,255,255,255,255,255,255,192,128,64^255,0,0,64,128,192,255,255,255,255,255,255,255,255,255,192,128,64,0,0,0,0,0,0,0,0^255,0,255,255,255,255,255,192,128,64,0,0,0,0,0,0,0,0,0,64,128,192,255,255,255,255)
remove_opacity..
index.. [-1],0,1
rm.
fx_smooth_antialias. 15,0,1,0,50,50
elif $flatColorEffect==3
otsu. 256 n. 0,255
fx_smooth_antialias. 15,0,1,0,50,50
elif $flatColorEffect==4
fx_posterize. 150,30,1,32,0,0,0,0,50,50
fx_custom_transform. "i","if(i<64,0, sqrt((i-64)/(256-64))*256 )","i","i","i","i",0
elif $flatColorEffect==5
if s==4 split_opacity. rm. fi
+colormap. 8
index.. [-1],0,1
rm.
rgb2hsl. split. c
n. 0,1
append c hsl2rgb
fi
remove_opacity.
if $bw==1
fx_curves_interactive. 7,0,1,"7","0,0,16,100,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1"
elif $bw==2
fx_blackandwhite. 0.299,0,0.587,0,0.114,0,0,0,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0,50,50
threshold. 33% n 0,255
fx_smooth_antialias. 100,0.5,5,0,50,50
fx_smooth_antialias. 100,0.5,5,0,50,50
elif $bw==3
fx_blackandwhite. 0.299,0,0.587,0,0.114,0,0,0,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0,50,50
otsu 4
n 0,255
fi
else
remove[-1]
fi
if $reliefEffect==1
# inspired by emboss_image of Reptorian
+fx_curves_interactive. 7,0,1,"7","0,0,16,100,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1"
l.
b. 3
gradient2rgb. 0 n. 0,255
[-1]
rgb2hsv[-2,-1] split[-2,-1] c
l[-3--1] +[-3] {315} %[-3] 360 done
l[-6--4] +[-3] {135} %[-3] 360 done
l[-3--1] a c hsv2rgb s c done
l[-6--4] a c hsv2rgb s c done
rm[^-6,-3]
negate..
/ 2
+. 128
blend grainmerge,1
done
to_rgb
blend grainmerge,1
elif $reliefEffect==2
fx_frame. 0,100,0,100,0,0,255,255,255,255,2,0,0,0,255
fx_custom_transform. "i","if(i<64,0, sqrt((i-64)/(256-64))*256 )","i","i","i","i",0
fx_illuminate_shape2d. 0,0,0,0,0,255,1,1,4,0,0,3,1,1,4,10,75,30,40,40,80,0.2,1,0,0,-2,-2,2,0,0,0
crop. 2,2,{w-4},{h-4}
fi
if $specialEffect==1
+blur. 12.5
add[-2,-1] *. 0.8 add. 40
cut. 0,255
fx_smooth_antialias. 100,2,5,0,50,50
fx_frame_fuzzy. 12,12,30,5,255,255,255,255
jeje_clouds. 50,0.5
elif $specialEffect==2
fx_curves_interactive. 7,0,1,"7","0,0,100,100,-1,0,0,65,35,100,100,-1,0,0,50,50,100,100,-1,0,0,100,100,-1"
fx_stripes_y. 4,0,0,0,50,50
fx_simulate_grain. 0,1,0.2,100,0,0,0,0,0,0,0,0,0
fx_dirty. 1,1,0,0,0,50,50
elif $specialEffect==3
+fx_smooth_antialias. 100,0,5,0,50,50
fx_smooth_antialias. 100,0,5,0,50,50
fx_smooth_antialias. 100,0,5,0,50,50
fx_hardsketchbw. 80,100,1,0.1,50,0,0,0,50,50
fx_smooth_antialias. 100,0,5,0,50,50
fx_smooth_antialias. 100,0,5,0,50,50
otsu. 4 n. 0,255
fx_smooth_antialias. 15,0,1,0,50,50
fx_smooth_antialias. 50,50,2.5,0,50,50
blur.. 10
fx_smooth_bilateral.. 10,7,6,0,0
mul[-2,-1] n. 0,255
fi
if $finalAntialias==1
fx_smooth_antialias 50,50,2.5,0,50,50
elif $finalAntialias==2
fx_smooth_antialias. 15,0,1,0,50,50
fx_smooth_antialias 50,50,2.5,0,50,50
fi
}
test_comic_preview :
gui_split_preview "test_comic $*",${-3--1}