Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #****************************************
- #3D Conversion
- #****************************************
- #@gimp 3D Conversion : gimp_make3D, gimp_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","right foreground","left and right foreground","bottom and top
- foreground","central perspective outdoor","central perspective
- indoor","portrait","human","underwater")
- #@gimp : Stereo base = float(50,0,200)
- #@gimp : Depth control = float(0,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 : Flip left / right = bool(0)
- #@gimp : Use indivial 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 adjustment:")
- #@gimp : Black & White = bool (0)
- #@gimp : Output format = choice("Anaglyph red/cyan","Stereo pair small","Stereo
- pair big","Depth map only","Unalligned images")
- #@gimp : Gamma compensation = float(1,0,4)
- #@gimp : Color boost = float(1,0,4)
- #@gimp : Red / cyan compensation = float(0,-255,255)
- #@gimp : sep = separator(), note = note("<small>Author : <i>Tom Keil</i>.
- Last update : <i>2011/03/07</i>.</small>")
- #@gimp : note = link("Filter explained
- here","http://www.flickr.com/groups/gmic/discuss/72157626154386744/")
- gimp_make3D :
- #prepare image
- -if {$10==0} -to_rgb[0] --gimp_do_nothing[0]
- -else -luminance[0] -to_rgb[0] --gimp_do_nothing[0] -endif
- #define depth map
- -if {$9==0}
- -if {$1==0} --channels[-1] 2
- -gimp_channel_processing[-1] 1,{$3/25},{-$3*2.55},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-$3}
- -rv[-1,-2] -gimp_compose_softlight[-1,-2] {$3/200}
- -elif {$1==1} --luminance[-1]
- -gimp_channel_processing[-1] 1,{$3/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,{$3/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-$3}
- -elif {$1==4}
- --gimp_radial_gradient[-1] 0,0,0,255,255,255,255,255,1,$3,100,50,50
- -elif {$1==5}
- --gimp_radial_gradient[-1] 0,0,0,255,255,255,255,255,0,0,{100-$3},50,50
- -elif {$1==6}
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,1,0,$3,100
- -elif {$1==7}
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,0,{100-$3}
- -elif {$1==8}
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,{$3*2},{100-$3}
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,180,{$3*2},{100-$3}
- -compose_lighten[-1,-2]
- -elif {$1==9}
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,{$3*2},{100-$3}
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,270,{$3*2},{100-$3}
- -compose_lighten[-1,-2]
- -elif {$1==10}
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,{$3*2},{100-$3}
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,180,{$3*2},{100-$3}
- -compose_lighten[-1,-2]
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-$3}
- -compose_lighten[-1,-2]
- -elif {$1==11}
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,{$3*2},{100-$3}
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,180,{$3*2},{100-$3}
- -compose_lighten[-1,-2]
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-$3}
- -compose_lighten[-1,-2]
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,270,{$3*2},{100-$3}
- -compose_lighten[-1,-2]
- -elif {$1==12} --channels[-1] 0
- -gimp_channel_processing[-1] 1,{$3/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,$3,100,50,50
- -rv[-1,-2] -compose_multiply[-1,-2]
- -elif {$1==13} --channels[-1] 0
- -gimp_channel_processing[-1] 1,{$3/25},0,0,0,0,100,256,0,0,0,2,0,0
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,{$3*2},{100-$3}
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,180,{$3*2},{100-$3}
- -compose_lighten[-1,-2]
- --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-$3}
- -compose_lighten[-1,-2]
- -rv[-1,-2] -compose_lighten[-1,-2]
- -elif {$1==14} --channels[-1] 0
- -gimp_channel_processing[-1] 1,{$3/25},0,0,0,0,100,256,0,0,0,2,0,0
- -endif
- -if {$4!=0} --gimp_gradient_norm[0] 0,1,0,100,1,0
- -rv[-1,-2] -compose_multiply[-1,-2] -gimp_segment_watershed[-1] $4,$5,0,0 -endif
- -if {$6!=0} --luminance[0] -gimp_map_tones[-1] 1,0,0,30,3,0
- -rv[-1,-2] -gimp_compose_overlay[-1,-2] {$6/5} -endif
- -if {$7!=0} --gimp_isophotes[0] {{$7*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] {$7/5} -endif
- -gimp_gaussian_blur[-1] 0,{{w+h}/700},{{w+h}/350},1,0,0,0
- -else -rv[1,-1] -to_rgb[-1] -luminance[-1]
- -endif -n[-1] 0,255
- #allign stereoscopic view
- -if {$11!=3}
- -r[-1] 100%,100%,1,2 -s[-1] c -f[-1] 0 -n[-2] 0,$2 -a[-1,-2] c
- -warp[-2] [-1],1 -rm[-1] -endif
- -if {$11==0} -s c
- -if {$8==0} -rm[-1,-2,-6] -mv[-1] 0 -a[-1,-2,-3] c
- -else -rm[-3,-4,-5] -a[-1,-2,-3] c -endif
- -elif {$11==1} -if {$8==1} -rv[-1,-2] -endif
- -r[-1,-2] 50%,50% -a[-1,-2] x
- -elif {$11==2} -if {$8==1} -rv[-1,-2] -endif -a[-1,-2] x
- -elif {$11==3} -k[-1] -elif {$11==4} -rv[-1,-2] -endif
- #adjust output images
- -apply_gamma $12
- -gimp_mix_lab 1,0,0,$13,0,0,$13,0,0,0,2,0
- -if {$11==0} -gimp_mix_rgb 1,$14,0,1,0,0,1,0,0,0,2,0 -endif
- #************END OF FILTER***************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement