#@gmic
#@gimp <b>{Tom Keil's filters}</b>
#**************************************
#ABOUT
#**************************************
#@gimp About : _none_, gimp_tk_about
#@gimp : note = note{"
#@gimp : <span foreground="purple">( <b>T</b>om Keil´s <b>F</b>ilter <b>S</b>et for <b>G'MIC</b>)</span>\n\nis proposed to you by"}
#@gimp : note = note("Tom Keil")
#@gimp : note = note{"\n"}
#@gimp : sep = separator()
#@gimp : note = note{"
#@gimp : The source code of this set of filters and additional informations and tutorials are available at :"}
#@gimp : note = link("http://www.tkfilter.bplaced.net")
#@gimp : "}
#@gimp : sep = separator()
#@gimp : note = note{"\nThe filters in this folder are still under development and may be subject to changes. Some filters appearing here are also part of the main filter tree of G´MIC. If they appear here too it means there are changes and updates not yet implemented in the main filter tree."}
gimp_tk_about :
-gimp_logo "Tom Keil´s Filters"
#****************************************
# Object animation
#****************************************
#@gimp Object animation : gimp_tk_animateobject, gimp_tk_animateobject(1)
#@gimp : sep = separator()
#@gimp : note = note("Object motion:")
#@gimp : X-motion = float(0,-100,100)
#@gimp : Y-motion = float(0,-100,100)
#@gimp : Z-motion = float(0,-10,50)
#@gimp : sep = separator()
#@gimp : note = note("Camera position:")
#@gimp : Camera X = float(0.5,0,1)
#@gimp : Camera Y = float(0.5,0,1)
#@gimp : sep = separator()
#@gimp : note = note("Frame settings:")
#@gimp : Frame size = int(400,50,1920)
#@gimp : Frames = int(2,2,100)
#@gimp : Reverse motion = bool(0)
#@gimp : note = note("<small>Your mask must be placed below your image. Switch input layers to <i><b>Active and below</b></i>.</small>")
#@gimp : sep = separator()
#@gimp : Work on frameset = bool(0)
#@gimp : note = note("<small>To use this option your mask must be placed below your frames. Switch input layers to <i><b>All</b></i>.</small>")
#@gimp : sep = separator()
#@gimp : note = note("Advanced settings:")
#@gimp : Sharpen object = float(0,0,10)
#@gimp : Expand background reconstruction = float(0,0,50)
#@gimp : Smoothen background reconstruction = float(0,0,1)
#@gimp : Adjust background reonstruction = float(1,1,256)
#@gimp : Blue screen mode = bool(0)
#@gimp : note = note("<small>Layer stack for images: Object image top, background image below, mask bottom. Layer stack for framesets: Frameset top, object image below, mask bottom. Switch input layers to <i><b>All</b></i>.</small>")
#@gimp : sep = separator(), note = note("<small>Author : <i>Tom Keil</i>. Last update : <i>2011/05/06</i>.</small>")
#@gimp : note = link("Filter explained here",http://www.tkfilter.bplaced.net/TKFilter%20tutorials%20animated%20objects.html)
gimp_tk_animateobject :
#resize and reconstruct single image background
-to_rgb -if {$9==0}
-r {w*{$6/max(w,h)}},{h*{$6/max(w,h)}}
-if {$14==0}
--gimp_do_nothing[-1,-2] --gimp_do_nothing[0] -rv[0,1]
-blur_xy[0] $11 -t2[0] $13,256 -n[0] 0,255
-gimp_replace_color[0] 1,0,0,0,0,255,0,0,0,0
-blur_xy[0] $12 -inpaint[1] [0]
-rm[0] -rv[-1,-2]
-else --gimp_do_nothing[0] -rv[0,1] -rv[-1,-2]
--gimp_do_nothing[0] --gimp_do_nothing[0]
--gimp_do_nothing[-3] --gimp_do_nothing[-1]
-to_gray[-1,-2] -t2[-1,-2] 128,256 -n[-1,-2] 0,255
-s[1] c -a[1,2,3,-1] c
-s[2] c -a[2,3,4,-1] c
-rv[1,-1] -compose_rgba[1,-1]
-rv[2,-1] -compose_rgba[2,-1]
-to_rgb[1,2]
-endif
#construct object views
dx=0 dy=0 dz=1 -repeat $7
dx={$dx+{$1/$7}} dy={$dy+{$2/$7}}
-shift[-1,-2] $dx%,$dy%
-if {$3>=0} dz={$dz+{{$3}/$7}}
-else dz={$dz-{{{1-{10.01+$3}/10}}/$7}} -endif
--gimp_zoom[-1,-2] $dz,$4,$5,0
-to_gray[-1] -t2[-1] 128,256 -n[-1] 0,255 -to_rgb[-2]
-s[-2] c -a[-4,-3,-2,-1] c
-if {$10!=0} -unsharp[-1] {$10/5},{$10/2},0 -cut[-1] 0,255 -endif
-mv[-1] -3 -done -rm[-1,-2] -rv -rv[-1,-2]
#combine object views with background
index={-3} -repeat $7
--gimp_do_nothing[-2] -rv[-1,-2] index={$index-1}
-rv[-3,$index] -compose_rgba[-3,$index]
-done -rm[-2] -if {$8==1} -rv -endif
-else
#construct background on frameset
-if {$14==0} frames={@#-1} counter={-5}
--gimp_do_nothing[-1,-2]
--blur_xy[-1] $11 -t2[-1] $13,256 -n[-1] 0,255
-gimp_replace_color[-1] 1,0,0,0,0,255,0,0,0,0
-blur_xy[-1] $12
-repeat $frames -inpaint[$counter] [-1]
counter={$counter-1} -done -rm[-1,-4]
#create and combine object views on frameset
--gimp_do_nothing[-1,-2]
-else frames={@#-2} --to_gray[-1]
-s[-3] c -a[-5,-4,-3,-1] c
--to_gray[-1] --fc[-1] 0,0,0
-rv[-1,-4] -compose_rgba[-1,-4] -mv[-1] -3
-endif
counter={-6} dx=0 dy=0 dz=1 -repeat {$frames}
--gimp_do_nothing[-1,-2]
-shift[-1,-2] $dx%,$dy%
-if {$3>=0} dz={$dz+{{$3}/$frames}}
-else dz={$dz-{{{1-{10.01+$3}/10}}/$frames}} -endif
--gimp_zoom[-1,-2] $dz,$4,$5,0
-to_gray[-1] -t2[-1] 128,256 -n[-1] 0,255 -to_rgb[-2]
-s[-2] c -a[-4,-3,-2,-1] c
-if {$10!=0} -unsharp[-1] {$10/5},{$10/2},0 -cut[-1] 0,255 -endif
-mv[-1] $counter
-compose_rgba[$counter,{$counter-1}]
dx={$dx+{$1/$frames}} dy={$dy+{$2/$frames}}
counter={$counter-1}
-rm[-1,-2]
-done -rm[-1,-2,-3]
-endif
#*****END OF FILTER**********************
#****************************************
#3D Conversion
#****************************************
#@gimp 3D Conversion : gimp_tk_make3D, gimp_tk_make3D(1)
#@gimp : sep = separator()
#@gimp : note = note("Stereoscopic settings:")
#@gimp : Scene selector = choice("daylight scene","light motive","dark motive","landscape","center foreground","center background","left foreground","left diagonal foreground","right foreground","right diagonal foreground","left and right foreground","bottom and top foreground","central perspective outdoor","central perspective indoor","portrait","human 1","human 2","studio","underwater","flat")
#@gimp : Far point deviation = float(-20,-100,100)
#@gimp : Near point deviation = float(20,-100,100)
#@gimp : Depth field control = float(20,0,100)
#@gimp : Feature analyzer threshold = float(0,0,5)
#@gimp : Feature analyzer smoothness = float(0,0,5)
#@gimp : Local detail enhancer = float(0,0,5)
#@gimp : DOF analyzer = float(0,0,5)
#@gimp : Frequency analyzer = float(0,0,5)
#@gimp : Flip left / right = bool(0)
#@gimp : Use individual depth map = bool(0)
#@gimp : note = note("<small>To use this option your depth map must be placed below your image. Switch input layers to <i><b>Active and below</b></i>.</small>")
#@gimp : sep = separator()
#@gimp : note = note("Image settings:")
#@gimp : Black & White = bool (0)
#@gimp : Output format = choice("Anaglyph red/cyan","Anaglyph blue/yellow","Stereo pair small","Stereo pair big","Stereo pair bottom/top","Depth map only","Unaligned images")
#@gimp : Gamma compensation = float(1.2,0,4)
#@gimp : Color boost = float(1.2,0,4)
#@gimp : Anaglyph glasses adjustment = float(0,-100,100)
#@gimp : Autocrop = bool (1)
#@gimp : Bidirectional rendering = bool (0)
#@gimp : sep = separator()
#@gimp : note = note("Frame settings:")
#@gimp : Render multiple frames = bool (0)
#@gimp : Render routine for wiggle animations = bool (0)
#@gimp : Frames = int(2,2,100)
#@gimp : Frame size = int(200,50,1920)
#@gimp : sep = separator(), note = note("<small>Author : <i>Tom Keil</i>. Last update : <i>2011/04/26</i>.</small>")
#@gimp : note = link("Filter explained here",http://www.tkfilter.bplaced.net/TKFilter%20tutorials%202Dto3D%203D-automatic%20stereoscopic%20conversion.html)
gimp_tk_make3D :
# prepare image
-if {$12==0} -to_rgb[0] --gimp_do_nothing[0]
-else -luminance[0] -to_rgb[0] --gimp_do_nothing[0] -endif
# create depth map
-if {$11==0}
-if {$1==0} --channels[0] 2
-gimp_channel_processing[-1] 1,{{$4/25}+0.1},0,0,0,0,100,256,0,1,0,2,0,0
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-{$4/1.5}}
-rv[-1,-2] -gimp_compose_lighten[-1,-2] {0.5+{$4/200}}
-elif {$1==1} --luminance[-1]
-gimp_channel_processing[-1] 1,{$4/25},0,0,0,0,100,256,0,0,0,2,0,0
-elif {$1==2} --luminance[-1] -negative[-1]
-gimp_channel_processing[-1] 1,{$4/25},0,0,0,0,100,256,0,0,0,2,0,0
-elif {$1==3}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-$4}
-elif {$1==4}
--gimp_radial_gradient[-1] 0,0,0,255,255,255,255,255,1,$4,100,50,50
-elif {$1==5}
--gimp_radial_gradient[-1] 0,0,0,255,255,255,255,255,0,0,{100-$4},50,50
-elif {$1==6}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,1,0,$4,100
-elif {$1==7}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,1,315,$4,100
-elif {$1==8}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,0,{100-$4}
-elif {$1==9}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,45,0,{100-$4}
-elif {$1==10}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,50,{100-{$4/2}}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,180,50,{100-{$4/2}}
-compose_lighten[-1,-2]
-elif {$1==11}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,50,{100-{$4/2}}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,270,50,{100-{$4/2}}
-compose_lighten[-1,-2]
-elif {$1==12}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,50,{100-{$4/4}}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,180,50,{100-{$4/4}}
-compose_lighten[-1,-2]
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-{$4/2}}
-compose_lighten[-1,-2]
-elif {$1==13}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,50,{100-{$4/4}}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,180,50,{100-{$4/4}}
-compose_lighten[-1,-2]
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-{$4/4}}
-compose_lighten[-1,-2]
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,270,50,{100-{$4/4}}
-compose_lighten[-1,-2]
-elif {$1==14} --channels[-1] 0
-gimp_channel_processing[-1] 1,{$4/25},0,0,0,0,100,256,0,0,0,2,0,0
--gimp_radial_gradient[-1] 0,0,0,255,255,255,255,255,1,$4,100,50,50
-rv[-1,-2] -compose_multiply[-1,-2]
-elif {$1==15}
--gimp_gaussian_blur[-1] $6,0,0,1,0,0,0
-gimp_edges[-1] {$6/2},{50-{$4/2}},1,0
--gimp_gradient_norm[0] {$6/2},{1.5-{$4/67}},0,{100-$4},0,0
-rv[-1,-2] -compose_lighten[-1,-2] --channels[0] 0
-gimp_channel_processing[-1] 1,{{$4/25}+1},0,0,0,0,100,256,0,0,0,2,0,0
-rv[-1,-2] -compose_lighten[-1,-2]
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,50,{100-{$4/4}}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,180,50,{100-{$4/4}}
-compose_lighten[-1,-2]
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-{$4/2}}
-compose_lighten[-1,-2] -rv[-1,-2] -compose_lighten[-1,-2]
-elif {$1==16} --gimp_gaussian_blur[-1] $6,0,0,1,0,0,0
-gimp_edges[-1] {$6/2},{50-{$4/2}},1,0
--gimp_gradient_norm[0] {$6/2},{1.5-{$4/67}},0,{100-$4},0,0
-rv[-1,-2] -compose_lighten[-1,-2] --channels[0] 0
-gimp_channel_processing[-1] 1,{{$4/25}+0.5},0,0,0,0,100,256,0,0,0,2,0,0
-rv[-1,-2] -compose_lighten[-1,-2]
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,0,{100-$4}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,180,0,{100-$4}
-compose_darken[-1,-2] -rv[-1,-2] -compose_darken[-1,-2]
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,75,{100-{$4/4}}
-rv[-1,-2] -gimp_compose_lighten[-1,-2] 0.5
-elif {$1==17} --gimp_gaussian_blur[-1] $6,0,0,1,0,0,0
-gimp_edges[-1] {$6/2},{50-{$4/2}},1,0
--gimp_gradient_norm[0] {$6/2},{1.5-{$4/67}},0,{100-$4},0,0
-rv[-1,-2] -compose_lighten[-1,-2] --channels[0] 0
-gimp_channel_processing[-1] 1,{{$4/25}+0.5},0,0,0,0,100,256,0,0,0,2,0,0
-rv[-1,-2] -compose_lighten[-1,-2]
-elif {$1==18} --channels[-1] 0
-gimp_channel_processing[-1] 1,{$4/25},0,0,0,0,100,256,0,0,0,2,0,0
-elif {$1==19} --fc[-1] 0,0,0
-endif
# individual depth map
-else -rv[1,-1] -to_rgb[-1] -luminance[-1] -endif
# analyze image features
-if {$9!=0}
--fc[0] 128,128,128 --channels[0] 2 -negative[-1] -c[-1] 0,90
-n[-1] 0,128 -rv[-1,-2] -compose_darken[-1,-2]
--channels[0] 0 -negative[-1] -c[-1] 165,255 -n[-1] 128,255 -rv[-1,-2] -compose_hardlight[-1,-2] -rv[-1,-2]
-if {$11==0} -if {$1!=19} -gimp_compose_average[-1,-2] {$9/5}
-else -gimp_compose_value[-1,-2] {$9/5},0
-gimp_channel_processing[-1] 1,{$4/25},0,0,0,0,100,256,0,0,0,2,0,0
-endif
-else -gimp_compose_value[-1,-2] {$9/5},0 -endif -endif
-if {$8!=0} --gimp_isophotes[0] {{$8*3}+2},0,0,0
-gimp_channel_processing[-1] 1,1,255,0,0,0,100,256,0,0,0,2,0,0
-gimp_gaussian_blur[-1] {{w+h}/350},0,0,1,0,0,0
-rv[-1,-2] -gimp_compose_overlay[-1,-2] {$8/5} -endif
-if {$5!=0} --gimp_gradient_norm[0] {$6*2},{1.5-{0.1+{$5/3.6}}},0,100,0,0
-rv[-1,-2] -compose_lighten[-1,-2] -gimp_segment_watershed[-1] $5,$6,0,0
-endif
-if {$7!=0} --luminance[0] -gimp_map_tones[-1] 1,{0.25-{$7/20}},0,30,3,0
-rv[-1,-2] -gimp_compose_overlay[-1,-2] {$7/10} -endif
-if {$11==0} -gimp_gaussian_blur[-1] 0,{{w+h}/700},{{w+h}/350},1,0,0,0 -endif
-n[-1] 0,255
#frame size for multiple frames
-if {$19==1} -r {w*{$22/max(w,h)}},{h*{$22/max(w,h)}} -endif
#create second view
-if {$19==0}
-if {$13!=5} -if {$18==0}
-if {$3<=0} -negative[-1] -endif
-r[-1] 100%,100%,1,2 -s[-1] c -f[-1] 0 -n[-2] 0,$3 -a[-1,-2] c
-warp[-2] [-1],1 -shift[-2] $2,0 -rm[-1]
-else
--gimp_do_nothing[-1] -r[-1,-2] 100%,100%,1,2
-s[-1] c -f[-1] 0 -n[-2] 0,{abs($3/2)} -a[-1,-2] c
-negative[-2] -s[-2] c -f[-2] 0 -n[-3] 0,{-abs($3/2)} -a[-2,-3] c
-warp[-4] [-2],1 -warp[-3] [-1],1
-shift[-3] $2,0 -rm[-1,-2]
-endif -endif
-else
#create multiple frames
-if {$18==0}
count={$21} dev=0 -repeat $count dev={$dev+{$3/$21}}
--gimp_do_nothing[0] -rv[-1,-2]
-if {$3<=0} -negative[-1] -endif
-r[-1] 100%,100%,1,2 -s[-1] c -f[-1] 0
-if {$20==0} -n[-2] 0,$dev -else -n[-2] {-$dev},$dev -endif
-a[-1,-2] c -warp[-2] [-1],1 -to_gray[-1] -n[-1] 0,255
-if {$3<=0} -negative[-1] -endif
-done -rm[-1,0] -rv
-else
count={abs($21/2)} dev=0
-repeat $count dev={$dev+{$3/$count}}
--gimp_do_nothing[-2] -rv[-1,-2]
--gimp_do_nothing[-2] -rv[-1,-2]
--gimp_do_nothing[-1] -r[-1,-2] 100%,100%,1,2
-s[-1] c -f[-1] 0
-if {$20==0} -n[-2] 0,{abs($dev/2)}
-else -n[-2] {-abs($dev/2)},{abs($dev/2)} -endif
-a[-1,-2] c
-negative[-2] -s[-2] c -f[-2] 0
-if {$20==0} -n[-3] 0,{-abs($dev/2)}
-else -n[-3] {-abs($dev/2)},{abs($dev/2)} -endif
-a[-2,-3] c
-warp[-4] [-2],1 -warp[-3] [-1],1 -rm[-2] -to_gray[-1] -n[-1] 0,255
-mv[-4] -1 -done -rm[-1,-2] -mv[0--1:2] -1 -rv[0-50%] -mv[0] 50%
-endif -endif
#crop images
-if {$19==0} -if {$17==1} -if {$13!=5}
-if {$2>=0} -crop[-1,-2] $2,0,{w},{h} -else -crop[-1,-2] 0,0,{w+$2},{h} -endif
-if {$18==0}
-if {$3>=0} -crop[-1,-2] $3,0,{w},{h} -else -crop[-1,-2] 0,0,{w+$3},{h} -endif
-else -crop[-1,-2] {abs($3/2)},0,{w-abs($3/2)},{h}
-endif -endif -endif -endif
#allign stereoscopic image
-if {$19==0} -if {$13==0} -if {$10==0} -rv[-1,-2] -endif -s c
-rm[-3,-4,-5] -a[-1,-2,-3] c
-elif {$13==1} -if {$10==0} -rv[-1,-2] -endif -s c
-rm[-6,-5,-1] -mv[0] 3 -a[-1,-2,-3] c
-elif {$13==2} -if {$10==1} -rv[-1,-2] -endif
-r[-1,-2] 50%,50% -a[-1,-2] x
-elif {$13==3} -if {$10==1} -rv[-1,-2] -endif -a[-1,-2] x
-elif {$13==4} -if {$10==1} -rv[-1,-2] -endif -a[-1,-2] y
-elif {$13==5} -k[-1] -elif {$13==6} -rv[-1,-2] -endif
-endif
#adjust output images
-apply_gamma $14
-gimp_mix_lab 1,0,0,$15,0,0,$15,0,0,0,2,0
-if {$13==0} -gimp_mix_rgb 1,$16,0,1,0,0,1,0,0,0,2,0 -endif
-if {$13==1} -gimp_mix_rgb 1,0,0,1,0,0,1,$16,0,0,2,0 -endif
#************END OF FILTER***************
#****************************************
# Vintage style
#****************************************
#@gimp Vintage style : gimp_tk_vintage, gimp_tk_vintage_preview(1)
#@gimp : Exposure = float(2,-5,5)
#@gimp : Contrast = float(0.85,0.5,1.5)
#@gimp : Saturation = float(0.7,0,4)
#@gimp : Shadows threshold = float(80,0,128)
#@gimp : Highlights threshold = float(200,128,255)
#@gimp : Transition smoothness = float(5,0,50)
#@gimp : sep = separator()
#@gimp : Color shadows = color(147,26,161)
#@gimp : Strength shadows = float(0.3,0,1)
#@gimp : Color midtones = color(235,220,176)
#@gimp : Strength midtones = float(0.4,0,1)
#@gimp : Color highlights = color(190,181,108)
#@gimp : Strength highlights = float(0.2,0,1)
#@gimp : Color exclusion = color(0,0,100)
#@gimp : Strength exclusion = float(0.3,0,1)
#@gimp : sep = separator()
#@gimp : Vignette size = float(25,0,100)
#@gimp : Vignette strenth = float(0,0,1)
#@gimp : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical")
#@gimp : sep = separator(), note = note("<small>Author : <i>Tom Keil</i>. Last update : <i>2011/04/08</i>.</small>")
#@gimp : note = link("Filter explained here",http://www.tkfilter.bplaced.net/TKFilter%20filter.html)
gimp_tk_vintage :
-repeat @# -l[$>]
-to_rgb[0] --luminance[0] --luminance[0] --luminance[0]
-gimp_mix_lab[0] $2,{$1*10},0,$3,0,0,$3,0,0,0,2,0
-gimp_channel_processing[-1] 1,1,0,0,4,{$4/2.55},100,256,0,1,0,2,0,0
-gimp_channel_processing[-2] 1,1,0,0,4,{$4/2.55},{$5/2.55},256,0,0,0,2,0,0
-gimp_channel_processing[-3] 1,1,0,0,4,0,{$5/2.55},256,0,1,0,2,0,0
-to_gray[-1,-2,-3] -gimp_gaussian_blur[-1,-2,-3] $6,0,0,1,0,0,0
--fc[0] $7,$8,$9 --fc[0] $11,$12,$13 --fc[0] $15,$16,$17 -to_rgba[-1,-2,-3]
-s[-1] c -rv[-1,-9] -compose_multiply[-1,-9] -mv[-8] 9 -a[-4,-3,-2,-1] c
-s[-2] c -rv[-2,-8] -compose_multiply[-2,-8] -mv[-7] 7 -a[-5,-4,-3,-2] c
-s[-3] c -rv[-3,-7] -compose_multiply[-3,-7] -mv[-6] 5 -a[-6,-5,-4,-3] c
--fc[0] $19,$20,$21 -rv[-1,-5] -gimp_compose_exclusion[-1,-5] $22
-rv[-3,-4] -gimp_compose_lighten[-3,-4] $10
-rv[-2,-3] -gimp_compose_overlay[-2,-3] $14
-rv[-1,-2] -gimp_compose_darken[-1,-2] $18
-if {$24!=0}
--fc[0] 255,255,255 -gimp_frame_round[-1] 2,$23,0,0,0,0,0,255,100,0.1,3
-gimp_gaussian_blur[-1] {$6*5},0,0,1,0,0,0
-rv[-1,-2] -gimp_compose_multiply[-1,-2] $24 -endif
-endl -done
gimp_tk_vintage_preview :
-gimp_split_preview "-gimp_tk_vintage ${1--2}",$-1
#*******END OF FILTER********************
#****************************************
# STEREOGRAM
#****************************************
#@gimp Single image stereogram : gimp_tk_stereogram, gimp_tk_stereogram_preview(1)
#@gimp : sep = separator()
#@gimp : Deviation = float(50,0,200)
#@gimp : sep = separator(), note = note("Pattern generator")
#@gimp : Pattern variation 1 = float(0.5,0,1)
#@gimp : Pattern variation 2 = float(10,0,20)
#@gimp : Pattern variation 3 = float(0,0,1)
#@gimp : Tiles = int(40,10,100)
#@gimp : Color 1 = color(255,255,0)
#@gimp : Color 2 = color(255,0,0)
#@gimp : Color 3 = color(0,255,0)
#@gimp : Color 4 = color(0,0,255)
#@gimp : Color strength = float(0.5,0,1)
#@gimp : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical")
#@gimp : sep = separator(), note = note("<small>Author : <i>Tom Keil</i>. Last update : <i>2011/04/02</i>.</small>")
#@gimp : note = note("Input image should be a <b>depth map</b> which is turned into an autostereogram, also known as magic eye image")
#@gimp : note = link("Filter explained here",http://www.tkfilter.bplaced.net/TKFilter%20filter.html)
#@gimp : note = link("Background explained here","http://en.wikipedia.org/wiki/Autostereogram"))
gimp_tk_stereogram :
-repeat @# -l[$>] -to_gray --fc[-1] 255,255,255
-gimp_plasma[-1] $2,$3
-gimp_array[-1] 10,10,0,0,0,0
-gimp_array_fade[-1] {$5/10},{$5/10},0,0,80,90,3,0
-r[-1] [0],[0]
-gimp_noise[-1] {w/30},0,3,0,0
--gimp_rorschach[-1] $4,1,0 -rv[-1,-2] -gimp_compose_multiply[-1,-2] 0.5 --gimp_corner_gradient[-1] $6,$7,$8,255,$9,$10,$11,255,$12,$13,$14,255,$15,$16,$17,255
-rv[-1,-2] -gimp_compose_hardlight[-1,-2] $18
-rv[-1,-2]
-r[-1] 100%,100%,1,2
-s[-1] c -f[-1] 0 -n[-2] 0,$1 -a[-1,-2] c
-warp[-2] [-1],1
-rm[-1] -endl -done
gimp_tk_stereogram_preview :
-gimp_split_preview "-gimp_tk_stereogram ${1--2}",$-1
#*******END OF FILTER********************
#****************************************
#Mask Creator
#****************************************
#@gimp Mask Creator : gimp_tk_mask, gimp_tk_mask_preview(1)
#@gimp : sep = separator()
#@gimp : Mask Type = choice("Luminance","Saturation","Hue","LAB-lightness")
#@gimp : Color Channels = choice("All","Red","Green","Blue","Yellow","Magenta","Cyan","LAB-A","LAB-B")
#@gimp : Shadows threshold = float(0,0,255)
#@gimp : Highlights threshold = float(255,0,255)
#@gimp : Tones Smoothness = float(0,0,20)
#@gimp : Mask Contrast = float(1,0,10)
#@gimp : Negative = bool(0)
#@gimp : Apply Mask = bool(0)
#@gimp : Transparency = float(1,0,1)
#@gimp : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical")
#@gimp : sep = separator(), note = note("<small>Author : <i>Tom Keil</i>. Last update : <i>2011/04/11</i>.</small>")
#@gimp : note = link("Filter explained here",http://www.tkfilter.bplaced.net/TKFilter%20filter.html)
gimp_tk_mask :
-repeat @# -l[$>]
-if {$8==1} --to_rgba[-1] -rv[-1,-2] -endif -to_rgb[-1]
-if {$2==1} -channels[-1] 0
-elif {$2==2} -channels[-1] 1
-elif {$2==3} -channels[-1] 2
-elif {$2==4} -rgb2cmy -channels[-1] 2
-elif {$2==4} -rgb2cmy -channels[-1] 1
-elif {$2==4} -rgb2cmy -channels[-1] 0
-elif {$2==5} -rgb2lab -channels[-1] 1
-elif {$2==6} -rgb2lab -channels[-1] 2
-endif -to_rgb[-1]
-if {$1==0} -luminance[-1] --luminance[-1]
-elif {$1==1} -rgb2hsv[-1] -channels[-1] 1
-n[-1] 0,255 --gimp_do_nothing[-1]
-elif {$1==2} -rgb2hsv[-1] -channels[-1] 0
-n[-1] 0,255 --gimp_do_nothing[-1]
-elif {$1==3} -rgb2lab[-1] -channels[-1] 0
-n[-1] 0,255 --gimp_do_nothing[-1]
-endif
-c[-1] $3,255 -n[-1] 0,255
-f[-2] "if(i<$4,if(c==0,i,i),0)"
-gimp_gaussian_blur[-1,-2] $5,0,0,1,0,0,0
-compose_darken
-if {$8==1} -rv[-1,-2] -endif
-gimp_channel_processing[-1] 1,$6,0,0,0,0,100,256,0,0,0,2,0,0
-if {$7==1} -negative[-1] -endif
-if {$8==1} -s[-2] c -rv[-1,-2]
-gimp_compose_multiply[-1,-2] $9
-a[-4,-3,-2,-1] c
-endif -endl -done
gimp_tk_mask_preview :
-gimp_split_preview "-gimp_tk_mask ${1--2}",$-1
#*******END OF FILTER********************
#****************************************
#metallic look Filter
#****************************************
#@gimp Metallic look : gimp_tk_metallic, gimp_tk_metallic_preview(1)
#@gimp : Strength = float(1,0,1)
#@gimp : Smoothness = float(0,0,20)
#@gimp : Metal = choice("silver","gold","copper","bronze","blue steel")
#@gimp : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical")
#@gimp : sep = separator(), note = note("<small>Author : <i>Tom Keil</i>. Last update : <i>2011/04/12</i>.</small>")
#@gimp : note = link("Filter explained here",http://www.tkfilter.bplaced.net/TKFilter%20filter.html)
gimp_tk_metallic :
-repeat @# -l[$>]
-gimp_gaussian_blur $2,0,0,1,1,0,0
-luminance --luminance
-gimp_apply_curve[1] 0,31,111,64,17,110,176,148,75,177,235,186,1,0,0,0,0
-gimp_apply_curve[1] 0,31,111,64,17,110,176,148,75,177,235,186,1,0,0,0,0
-rv[0,1] -gimp_compose_value[0,1] $1,0
-if {$3==1} -gimp_mix_rgb 1,50,0,1,50,0,1,-50,0,0,2,0
-elif {$3==2} -gimp_mix_rgb 1,75,0,1,5,0,1,-25,0,0,2,0
-elif {$3==3} -gimp_mix_rgb 1,70,0,1,40,0,1,-20,0,0,2,0
-elif {$3==4} -gimp_mix_rgb 1,-5,0,1,0,0,1.1,12,0,0,2,0
-endif -endl -done
gimp_tk_metallic_preview :
-gimp_split_preview "-gimp_tk_metallic ${1--2}",$-1
#*** END OF FILTER ***
#*******************************************************
#dynamic range increase
#*******************************************************
#@gimp Dynamic Range Increase : gimp_tk_dri, gimp_tk_dri_preview(1)
#@gimp : sep = separator()
#@gimp : Map Tones = float(0,0,1)
#@gimp : Recover Shadows = float(0,0,1)
#@gimp : Recover Highlights = float(0,0,1)
#@gimp : Enhance Details = float (1,0,5)
#@gimp : Detail Strength = float (0.5,0,1)
#@gimp : Map Tones = bool(1)
#@gimp : Enhance Details = bool(1)
#@gimp : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical")
#@gimp : sep = separator(), note = note("Author : Tom Keil / Last update : 2011/04/12")
#@gimp : note = link("Filter explained here",http://www.tkfilter.bplaced.net/TKFilter%20filter.html)
gimp_tk_dri :
-repeat @# -l[$>]
-if {$6==1}
--negative --to_rgba[0] --luminance[0] --to_rgba[0] --luminance[0]
-gimp_gaussian_blur[1] {{{w+h}/20}*{1.1-$1}},0,0,1,0,0,0 -to_gray[1]
-rv[0,1] -gimp_compose_softlight[0,1] $1
-gimp_gaussian_blur[2] {{w+h}/200},0,0,1,1,0,0 -negative[2] -to_gray[2]
-s[1] c -rv[4,5] -compose_multiply[4,5] -a[1,2,3,4] c -rv[0,1]
-gimp_compose_dodge[0,1] $2
-gimp_gaussian_blur[2] {{w+h}/200},0,0,1,1,0,0 -to_gray[2] -s[1] c
-rv[4,5] -compose_multiply[4,5] -a[1,2,3,4] c -rv[0,1]
-gimp_compose_colorburn[0,1] $3 -endif
-if {$7==1} --map_tones[0] 0.50,0.70,$4,50
--normalize_local[0] $4,6.00,5.00,1.00
-rv[0,1] -gimp_compose_value[0,1] $5,0
-rv[0,1] -gimp_compose_value[0,1] $5,0 -endif
-endl -done
gimp_tk_dri_preview :
-gimp_split_preview "-gimp_tk_dri ${1--2}",$-1
#*************END OF FILTER****************
#******************************************
#END OF DIRECTORY
#******************************************
#@gimp _