Advertisement
Guest User

Tom Keil

a guest
Jan 13th, 2011
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 9.18 KB | None | 0 0
  1. #@gimp Photoillustration: gimp_Photoillustration, gimp_Photoillustration_preview(0)
  2. #@gimp : note = note("adding an illustrative effect to any photograph")
  3. #@gimp : sep = separator()
  4. #@gimp : Local contrast style = choice("tone mapping","local normalisation","unsharp mask","global mapping","dynamic range increase","none")
  5. #@gimp : Local contrast effect = float(0.25,0.00,2.5)
  6. #@gimp : Smoothing style = choice("anisotropic","bilateral","color channel smoothing","segmentation","morphological closing","edge preserving","none")
  7. #@gimp : Contour precision = float(0.30,0.00,1.00)
  8. #@gimp : Area smoothness = float(0.50,0.00,10.00)
  9. #@gimp : Sharpening radius = float(0.50,0.00,10.00)
  10. #@gimp : Sharpening strength = float(1.00,0.00,5.00)
  11. #@gimp : Special effects = choice("none","soft glow","dusty","Orton glow","extra smooth","bloom","paintstroke")
  12. #@gimp : Effect strength = float(5.00,0.00,20.00)
  13. #@gimp : Overall lightness = float(0,-50,50)
  14. #@gimp : Overall contrast = float(1,0.5,1.5)
  15. #@gimp : Shadows lightness = float(0,-100,100)
  16. #@gimp : Highlights lightness = float(0,-100,100)
  17. #@gimp : Mid tone contrast = float(1,0.5,4)
  18. #@gimp : Color green-magenta = float(0,-20,20)
  19. #@gimp : Color blue-yellow = float(0,-20,20)
  20. #@gimp : Color boost = float(1.2,0,4)
  21. #@gimp : Detail reconstruction detection = float (98.5,50,100)
  22. #@gimp : Detail reconstruction smoothness = float(5,0,10)
  23. #@gimp : Detail reconstruction strength = float(0.5,0,1)
  24. #@gimp : Detail reconstruction style = choice("micro/macro details adjusted","fine","strong","high pass","artistic round","artistic hard","artistic modern","comic Style","gritty","none")
  25. #@gimp : Keep detail layer seperate = bool(0)
  26. #@gimp : Remove artifacts from micro/macro detail = bool(0)
  27. #@gimp : Skin tone protection = bool(0)
  28. #@gimp : Sharpen edges only = bool(0)  
  29. #@gimp : sep = separator()
  30. #@gimp : note = note("WARNING: this filter may run slow on larger images, downsize your image before running the filter if necessary")
  31. #@gimp : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical")
  32. #@gimp : sep = separator(), note = note("Author : Tom Keil / Last update : 2011/01/12")
  33. #@gimp : note = link("Filter explained here","http://www.mediafire.com/?nj2rhyc18ka861p")
  34.  
  35. #********************************************************
  36. #Photoillustration Filter VERSION 4.4 12.01.2011 Tom Keil
  37. #********************************************************
  38.  
  39. gimp_Photoillustration :
  40.  
  41.  -repeat @# -l[$>]
  42.  
  43.  -if {$21==0} --gimp_do_nothing --negative[1]                   #securing details from original
  44.  --gimp_do_nothing[0] --negative[0]
  45.  -gimp_gaussian_blur[2] {{{100-$18}/5}+0.5},0,0,1,0,0,0             #as adjusted micro and macro details
  46.  -gimp_compose_dodge[1,2] 1
  47.  -if {$23==1} -gimp_gaussian_blur[1] {{{100-$18}/10}+0.5},0,0,1,0,0,0 -endif  
  48.  -gimp_gaussian_blur[3] {{{{{100-$18}/5}+1}*10}+10},0,0,1,0,0,0
  49.  -gimp_compose_dodge[2,3] 1
  50.  -if {$23==1} -gimp_gaussian_blur[2] {{{{100-$18}/10}+0.5}*3},0,0,1,0,0,0 -endif       
  51.  -reverse[1,2] -gimp_compose_multiply[1,2] {1-{$19/10}}
  52.  -gimp_channel_processing[1] {{1-$20}+0.1},1,0,0,0,0,100,256,0,0,0,2,7,0
  53.  -elif {$21==1} --gimp_laplacian $19,{99.99-$18},$18,1,1,0          # securing details of original
  54.  -elif {$21==2} --gimp_gradient_norm $19,0.5,{99.99-$18},$18,1,0            # securing stronger details of original
  55.  -elif {$21==3} --gimp_highpass {-{$18-100.3}},{{10-$19}*0.7},0,1,0     # details as highpass
  56.  -elif {$21==4} --gimp_pencilbw {100-$18},{$19*20},0,0,0            # details as B&W pencil
  57.  -elif {$21==5} --gimp_hardsketchbw 2000,2,$19,0.1,{100-$18},0,0        # details as B&W hard sketch
  58.  -elif {$21==6} --gimp_thin_edges $19,{{$18/5}-10},0,0              # details as thin edges
  59.  -elif {$21==7} --gimp_edges {$19/3.5},{95-$18},0,0             # details as comic style
  60.  --gimp_mix_hsv[0] 1,0,0,1,-1,0,1,0,0,0,2,0
  61.  -gimp_channel_processing[2] 1,1,0,{$19/10},4,{{$18-50}*2},100,256,0,0,0,2,7,0
  62.  -reverse[1,2] -gimp_compose_multiply[1,2] {0.5+{$20/2}}
  63.  -elif {$21==8} --channels 2
  64.  -if {$19<=5} -gimp_unsharp[1] 1,{2-{{$19*0.3}+0.5}},20,{5-$19},0.00,1.00,0.5,1,0,7,0
  65.  -else -gimp_gaussian_blur[1] {$19-5},0,0,1,0,0,0  -endif
  66.  -endif
  67.  -if {$1!=3}  
  68.  -gimp_channel_processing[0] 1,1,$12,0,0,0,100,256,0,0,1,{abs($12/10)},7,0  # shadows correction
  69.  -gimp_channel_processing[0] 1,1,$13,0,0,0,100,256,0,0,3,{abs($12/10)},7,0  # highlights correction
  70.  -endif
  71.  -if {$24==0}
  72.  -if {$1==0} -gimp_map_tones[0] {$2/2.5},{1-{$2/2.5}},$2,{2+{$2*80}},3,0            # tone mapping in lightness
  73.  -elif {$1==1} -gimp_normalize_local[0] {$2*2},{1+{$2*25.2}},{$2*16},{$2*16},0,3,0      # local normalisation in luminosity
  74.  -elif {$1==2} -gimp_unsharp[0] 0,{{w+h}/100},0,$2,0,1,1,1,0,7,0            # USM wide radius in lightness
  75.  -elif {$1==3} --negative[0]
  76.  -if {$21!=9} -reverse[1,2] -endif
  77.  -gimp_gaussian_blur[1] {{{w+h}/5}-{$2*{{w+h}/12.5}}},0,0,1,0,0,0
  78.  -to_gray[1] -reverse[0,1] -gimp_compose_softlight[0,1] {$2/2.5}        # inverted overlay
  79.  -elif {$1==4} -gimp_dri[0] {$2/2.5},{$2/5},{$2/2.5},{$2*2},{$2/2.5},1,1,0
  80.  -endif                                     # as alternative local contrast enhancement
  81.  
  82.  -else                                      #skin protection
  83.  --to_rgba[0] --channels[0] 0 -if {$21!=9} -move[1] 4 -endif
  84.  -negative[2]  
  85.  -gimp_channel_processing[2] 1,1,2,0,0,0,100,256,0,0,0,2,7,0
  86.  -gimp_gaussian_blur[2] {{w+h}/500},0,0,1,0,0,0
  87.  -to_gray[2]
  88.  
  89.  -if {$1==0} -gimp_map_tones[1] {$2/2.5},{1-{$2/2.5}},$2,{2+{$2*80}},3,0            # tone mapping in lightness
  90.  -elif {$1==1} -gimp_normalize_local[1] {$2*2},{1+{$2*25.2}},{$2*16},{$2*16},0,3,0              # local normalisation in luminosity
  91.  -elif {$1==2} -gimp_unsharp[1] 0,100,0,$2,0,1,1,1,0,7,0
  92.  -elif {$1==3} -negative[1] -gimp_gaussian_blur[1] {{{w+h}/5}-{$2*{{w+h}/12.5}}},0,0,1,0,0,0
  93.  -to_gray[1] -to_rgba[1]  
  94.  -elif {$1==4} -gimp_dri[1] {$2/2.5},{$2/5},{$2/2.5},{$2*2},{$2/2.5},1,1,0 -to_rgba[1]
  95.  -endif
  96.  
  97.  -split[1] c
  98.  -if {$21!=9} -reverse[4,5] -compose_multiply[4,5] -append[-5,-4,-3,-2] c
  99.  -else -reverse[3,4] -compose_multiply[3,4] -append[-4,-3,-2,-1] c -endif
  100.  -if {$1!=3} -compose_rgba[0,1] -else -reverse[0,1]
  101.  -gimp_compose_softlight[0,1] {$2/2.5} -endif          
  102.  -endif                                     #end skin protection                 
  103.  
  104.  -gimp_channel_processing[0] 1,$11,$10,0,0,0,100,256,0,0,0,2,7,0        # general lightness and contrast settings
  105.  -gimp_channel_processing[0] 1,$14,0,0,0,0,100,256,0,0,2,{abs($14*2.5)},7,0     # mid tone contrast setting
  106.  -if {$1==3}  
  107.  -gimp_channel_processing[0] 1,1,$12,0,0,0,100,256,0,0,1,{abs($12/10)},7,0  # shadows correction
  108.  -gimp_channel_processing[0] 1,1,$13,0,0,0,100,256,0,0,3,{abs($12/10)},7,0  # highlights correction
  109.  -endif
  110.  -if {$3==0}                                    # different smoothing methods
  111.  -gimp_anisotropic_smoothing[0] {$5*100},{$4*2},$4,$5,$5,0.80,30.00,2.0,0,1,1,0,1,0
  112.  -elif {$3==1} -gimp_bilateral[0] {100-{$4*100}},{$5*25},1,0,0
  113.  -elif {$3==2} -gimp_gaussian_blur[0] {$5*10},0,0,1,8,0,0
  114.  -elif {$3==3} -gimp_segment_watershed[0] {$4*5},{$5/2},0,0
  115.  -elif {$3==4} -gimp_morpho[0] 3,{$5*2+2},0,2,0,1,0
  116.  -elif {$3==5} -gimp_edgepreserving_smoothing[0] {$4*2},$4,$5,$5,{{$5*4.5}+5},{{$5*9.9}+1},0,0
  117.  -endif
  118.  
  119.  -gimp_mix_lab[0] 1,0,0,$17,$15,0,$17,$16,0,0,2,0               # LAB mixer for colour boost effect
  120.    
  121.  -if {$25==0}
  122.  -gimp_unsharp[0] 1,$6,20,$7,0.00,1.00,0.5,1,0,7,0              # bilateral USM dark emphasized
  123.  -else
  124.  --to_rgba[0] --gimp_edges[0] $6,{30-{$7*5}},1,0 -if {$21!=9} -move[1] 4 -endif
  125.  -gimp_unsharp[1] 1,$6,20,$7,0.00,1.00,0.5,1,0,7,0
  126.  -gimp_gaussian_blur[2] {{w+h}/500},0,0,1,0,0,0
  127.  -to_gray[2]
  128.  -split[1] c
  129.  -if {$21!=9} -reverse[4,5] -compose_multiply[4,5] -append[-5,-4,-3,-2] c
  130.  -else -reverse[3,4] -compose_multiply[3,4] -append[-4,-3,-2,-1] c -endif
  131.  -compose_rgba[0,1]
  132.  -endif
  133.  
  134.  -if {$22==0}
  135.  -if {$21==3}  -reverse -gimp_compose_overlay $20                   # detail reconstruction from original
  136.  -elif {$21==8} -reverse -gimp_compose_hardlight $20
  137.  -elif {$21!=9} -reverse -gimp_compose_multiply $20  
  138.  -endif -endif    
  139.  
  140.  -if {$8==1}
  141.  -gimp_glow[0] $9,0,0                               # soft glow
  142.  
  143.  -elif {$8==2} --gimp_highpass[0] {$9*3},2,1,0,0                # inverse highpass
  144.  -if {{$22==1}&&{$21!=9}} -reverse[1,2] -endif
  145.  -reverse[0,1] -gimp_compose_overlay[0,1] {$9/40}
  146.  
  147.  -elif {$8==3} --gimp_do_nothing[0] --gimp_do_nothing[0]            # orton effect
  148.  -if {{$22==1}&&{$21!=9}} -reverse[1,3] -endif
  149.  -gimp_compose_screen[1,2] 1  -gimp_gaussian_blur[1] {$9*3},0,0,1,0,0,0
  150.  -reverse[0,1] -gimp_compose_softlight[0,1] {$9/20}
  151.  
  152.  -elif {$8==4}                                  # additional light smoothing
  153.  -gimp_anisotropic_smoothing[0] 30,1.5,0.3,{$9/4},1.10,0.80,30.00,2.0,0,1,1,0,1,0
  154.  
  155.  -elif {$8==5}
  156.  --gimp_mix_hsv[0] 1,0,0,1,-1,0,1,0,0,0,2,0                     # highlights bloom         
  157.  -if {{$22==1}&&{$21!=9}} -reverse[1,2] -endif
  158.  -gimp_channel_processing[1] 1,1,0,0,4,0,{100-{$9*2.5}},256,0,1,0,2,0,0            
  159.  -gimp_gaussian_blur[1] $9,0,0,1,0,0,0
  160.  -gimp_channel_processing[1] 1,1,0,0,4,0,{50-{$9*2}},256,0,1,0,2,0,0
  161.  -gimp_replace_color[1] 1,0,0,0,0,255,0,0,0,0              
  162.  -gimp_gaussian_blur[1] {$9*2},0,0,1,0,0,0
  163.  -reverse[0,1] -gimp_compose_softlight[0,1] {0.25+{$9/150}}
  164.  
  165.  -elif {$8==6}
  166.  -gimp_anisotropic_smoothing[0] 60,0.16,{{$9/50}+0.6},{{$9/9}+0.6},2.35,0.8,30,2,0,1,1,0,1
  167.  
  168.  -endif
  169.  
  170.  -endl -done                           
  171.  
  172. gimp_Photoillustration_preview :
  173.  
  174.  -gimp_split_preview "-gimp_Photoillustration ${1--2}",$-1
  175.  
  176. #*********** end of filter ************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement