Guest User

Untitled

a guest
Mar 6th, 2011
250
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #****************************************
  2. #3D Conversion
  3. #****************************************
  4.  
  5. #@gimp 3D Conversion : gimp_make3D, gimp_make3D(1)
  6. #@gimp : sep = separator()
  7. #@gimp : note = note("Stereoscopic settings:")
  8. #@gimp : Scene selector = choice("daylight scene","light motive","dark
  9.  
  10. motive","landscape","center foreground","center background","left
  11.  
  12. foreground","right foreground","left and right foreground","bottom and top
  13.  
  14. foreground","central perspective outdoor","central perspective
  15.  
  16. indoor","portrait","human","underwater")
  17. #@gimp : Stereo base = float(50,0,200)
  18. #@gimp : Depth control = float(0,0,100)
  19. #@gimp : Feature analyzer threshold = float(0,0,5)
  20. #@gimp : Feature analyzer smoothness = float(0,0,5)
  21. #@gimp : Local detail enhancer = float(0,0,5)
  22. #@gimp : DOF analyzer = float(0,0,5)
  23. #@gimp : Flip left / right = bool(0)
  24. #@gimp : Use indivial depth map = bool(0)
  25. #@gimp : note = note("<small>To use this option your depth map must be placed
  26.  
  27. below your image. Switch input layers to <i><b>Active and
  28.  
  29. below</b></i>.</small>")
  30. #@gimp : sep = separator()
  31. #@gimp : note = note("Image adjustment:")
  32. #@gimp : Black & White = bool (0)
  33. #@gimp : Output format = choice("Anaglyph red/cyan","Stereo pair small","Stereo
  34.  
  35. pair big","Depth map only","Unalligned images")
  36. #@gimp : Gamma compensation = float(1,0,4)
  37. #@gimp : Color boost = float(1,0,4)
  38. #@gimp : Red / cyan compensation = float(0,-255,255)
  39. #@gimp : sep = separator(), note = note("<small>Author : <i>Tom Keil</i>.      
  40.  
  41. Last update : <i>2011/03/07</i>.</small>")
  42. #@gimp : note = link("Filter explained
  43.  
  44. here","http://www.flickr.com/groups/gmic/discuss/72157626154386744/")
  45.  
  46. gimp_make3D :
  47.  
  48. #prepare image
  49.  
  50. -if {$10==0} -to_rgb[0] --gimp_do_nothing[0]
  51. -else -luminance[0] -to_rgb[0] --gimp_do_nothing[0] -endif
  52.  
  53. #define depth map
  54.  
  55. -if {$9==0}
  56. -if {$1==0} --channels[-1] 2
  57. -gimp_channel_processing[-1] 1,{$3/25},{-$3*2.55},0,0,0,100,256,0,1,0,2,0,0
  58. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-$3}
  59. -rv[-1,-2] -gimp_compose_softlight[-1,-2] {$3/200}
  60. -elif {$1==1} --luminance[-1]
  61. -gimp_channel_processing[-1] 1,{$3/25},0,0,0,0,100,256,0,0,0,2,0,0
  62. -elif {$1==2} --luminance[-1] -negative[-1]
  63. -gimp_channel_processing[-1] 1,{$3/25},0,0,0,0,100,256,0,0,0,2,0,0
  64. -elif {$1==3}
  65. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-$3}
  66. -elif {$1==4}  
  67. --gimp_radial_gradient[-1] 0,0,0,255,255,255,255,255,1,$3,100,50,50
  68. -elif {$1==5}
  69. --gimp_radial_gradient[-1] 0,0,0,255,255,255,255,255,0,0,{100-$3},50,50
  70. -elif {$1==6}
  71. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,1,0,$3,100
  72. -elif {$1==7}
  73. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,0,{100-$3}
  74. -elif {$1==8}
  75. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,{$3*2},{100-$3}
  76. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,180,{$3*2},{100-$3}
  77. -compose_lighten[-1,-2]
  78. -elif {$1==9}
  79. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,{$3*2},{100-$3}
  80. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,270,{$3*2},{100-$3}
  81. -compose_lighten[-1,-2]
  82. -elif {$1==10}
  83. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,{$3*2},{100-$3}
  84. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,180,{$3*2},{100-$3}
  85. -compose_lighten[-1,-2]
  86. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-$3}
  87. -compose_lighten[-1,-2]
  88. -elif {$1==11}
  89. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,{$3*2},{100-$3}
  90. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,180,{$3*2},{100-$3}
  91. -compose_lighten[-1,-2]
  92. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-$3}
  93. -compose_lighten[-1,-2]
  94. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,270,{$3*2},{100-$3}
  95. -compose_lighten[-1,-2]
  96. -elif {$1==12} --channels[-1] 0
  97. -gimp_channel_processing[-1] 1,{$3/25},0,0,0,0,100,256,0,0,0,2,0,0
  98. --gimp_radial_gradient[-1] 0,0,0,255,255,255,255,255,1,$3,100,50,50
  99. -rv[-1,-2] -compose_multiply[-1,-2]
  100. -elif {$1==13} --channels[-1] 0
  101. -gimp_channel_processing[-1] 1,{$3/25},0,0,0,0,100,256,0,0,0,2,0,0
  102. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,{$3*2},{100-$3}
  103. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,180,{$3*2},{100-$3}
  104. -compose_lighten[-1,-2]
  105. --gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-$3}
  106. -compose_lighten[-1,-2]
  107. -rv[-1,-2] -compose_lighten[-1,-2]
  108. -elif {$1==14} --channels[-1] 0
  109. -gimp_channel_processing[-1] 1,{$3/25},0,0,0,0,100,256,0,0,0,2,0,0
  110. -endif
  111. -if {$4!=0} --gimp_gradient_norm[0] 0,1,0,100,1,0
  112. -rv[-1,-2] -compose_multiply[-1,-2] -gimp_segment_watershed[-1] $4,$5,0,0 -endif
  113. -if {$6!=0} --luminance[0] -gimp_map_tones[-1] 1,0,0,30,3,0
  114. -rv[-1,-2] -gimp_compose_overlay[-1,-2] {$6/5} -endif
  115. -if {$7!=0} --gimp_isophotes[0] {{$7*3}+2},0,0,0
  116. -gimp_channel_processing[-1] 1,1,255,0,0,0,100,256,0,0,0,2,0,0
  117. -gimp_gaussian_blur[-1] {{w+h}/350},0,0,1,0,0,0
  118. -rv[-1,-2] -gimp_compose_overlay[-1,-2] {$7/5} -endif
  119. -gimp_gaussian_blur[-1] 0,{{w+h}/700},{{w+h}/350},1,0,0,0
  120. -else -rv[1,-1] -to_rgb[-1] -luminance[-1]  
  121. -endif -n[-1] 0,255
  122.  
  123. #allign stereoscopic view
  124.  
  125. -if {$11!=3}
  126. -r[-1] 100%,100%,1,2 -s[-1] c -f[-1] 0 -n[-2] 0,$2 -a[-1,-2] c
  127. -warp[-2] [-1],1 -rm[-1] -endif
  128. -if {$11==0} -s c
  129. -if {$8==0} -rm[-1,-2,-6]  -mv[-1] 0 -a[-1,-2,-3] c
  130. -else -rm[-3,-4,-5] -a[-1,-2,-3] c -endif
  131. -elif {$11==1} -if {$8==1} -rv[-1,-2] -endif
  132. -r[-1,-2] 50%,50% -a[-1,-2] x
  133. -elif {$11==2} -if {$8==1} -rv[-1,-2] -endif -a[-1,-2] x
  134. -elif {$11==3} -k[-1] -elif {$11==4} -rv[-1,-2]  -endif
  135.  
  136. #adjust output images
  137.  
  138. -apply_gamma $12
  139. -gimp_mix_lab 1,0,0,$13,0,0,$13,0,0,0,2,0
  140. -if {$11==0} -gimp_mix_rgb 1,$14,0,1,0,0,1,0,0,0,2,0 -endif
  141.  
  142. #************END OF FILTER***************
RAW Paste Data