Advertisement
Guest User

Untitled

a guest
Jul 9th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.47 KB | None | 0 0
  1. #@gui UltraWarp+++ : fx_ultrawarpplusplusplus, fx_ultrawarpplusplusplus(1)
  2. #@gui : note = note("Sequence of multiple partially-randomised texture generation and image deformation filters with multi-iteration warping"), sep = separator()
  3. #@gui : 1.  Quick Refresh Button = bool(0)
  4. #@gui : sep = separator()
  5. #@gui : 2.  Plasma Texture = bool(0)
  6. #@gui : 3.  Plasma Scale = float(2.5,0,20)
  7. #@gui : 4.  Plasma Alpha Channel = bool(0)
  8. #@gui : sep = separator()
  9. #@gui : 5.  Blur = float (0,0,30)
  10. #@gui : sep = separator()
  11. #@gui : 6.  Quadtree Pixelisation [no alpha channel] = bool(0)
  12. #@gui : 7.  Quadtree Min Precision = int(4,2,2048)
  13. #@gui : 8.  Quadtree Max Precision = int(256,0,2048)
  14. #@gui : 9.  Quadtree Min Homogeneity = float(0,0,5)
  15. #@gui : 10.  Quadtree Max Homogeneity = float(5,0,5)
  16. #@gui : sep = separator()
  17. #@gui : 11. Noise Type = choice(2,"Gaussian","Uniform","Salt and pepper","Poisson")
  18. #@gui : 12. Minimum Noise = float(0,0,200)
  19. #@gui : 13. Maximum Noise = float(1,0,200)
  20. #@gui : 14. Noise Channel(s) = choice(2,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-red chrominances]","YCbCr [blue chrominance]","YCbCr [red chrominance]","YCbCr [green chrominance]","Lab [lightness]","Lab [ab-chrominances]","Lab [a-chrominance]","Lab [b-chrominance]","Lch [ch-chrominances]","Lch [c-chrominance]","Lch [h-chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]")
  21. #@gui : sep = separator(), note = note("<small>Warping</small>")
  22. #@gui : 15. Warp Iterations = int(5,0,30)
  23. #@gui : 16. Warp Intensity = float(2,0,30)
  24. #@gui : 17. Warp Offset = int(10,0,2000)
  25. #@gui : 18. Correlated Channels = choice("Random","Off","On")
  26. #@gui : 19. Warp Channel(s) = choice(2,"Random","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-red chrominances]","YCbCr [blue chrominance]","YCbCr [red chrominance]","YCbCr [green chrominance]","Lab [lightness]","Lab [ab-chrominances]","Lab [a-chrominance]","Lab [b-chrominance]","Lch [ch-chrominances]","Lch [c-chrominance]","Lch [h-chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]")
  27. #@gui : 20. Random Negation = bool(1)
  28. #@gui : 21. Random Negation Channel(s) = choice(2,"Random","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-red chrominances]","YCbCr [blue chrominance]","YCbCr [red chrominance]","YCbCr [green chrominance]","Lab [lightness]","Lab [ab-chrominances]","Lab [a-chrominance]","Lab [b-chrominance]","Lch [ch-chrominances]","Lch [c-chrominance]","Lch [h-chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]")
  29. #@gui : 22. Gamma Offset = float(0.25,0,1)
  30. #@gui : 23. Hue Offset = float(1,0,1)
  31. #@gui : sep = separator(), note = note("<small>Final HSV Scaling</small>")
  32. #@gui : 24. Minimum Hue = float(0,0,20)
  33. #@gui : 25. Maximum Hue = float(5,0,20)
  34. #@gui : 26. Minimum Saturation = float(0.5,0,20)
  35. #@gui : 27. Maximum Saturation = float(5,0,20)
  36. #@gui : 28. Minimum Value = float(0,0,20)
  37. #@gui : 29. Maximum Value = float(2,0,20)
  38. #@gui : sep = separator(),
  39. #@gui : -2. Channel(s) = choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-red chrominances]","YCbCr [blue chrominance]","YCbCr [red chrominance]","YCbCr [green chrominance]","Lab [lightness]","Lab [ab-chrominances]","Lab [a-chrominance]","Lab [b-chrominance]","Lch [ch-chrominances]","Lch [c-chrominance]","Lch [h-chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]")
  40. #@gui : -1. Value action = choice("None","Cut","Normalize")
  41.  
  42. ultrawarpplusplusplus:
  43.  
  44. # plasma rendering and pixelisation followed by random warp with gamma and hue randomisation and final HSV scaling
  45.  
  46.   hue_min={$24}
  47.   hue_max={$25}
  48.   sat_min={$26}
  49.   sat_max={$27}
  50.   val_min={$28}
  51.   val_max={$29}
  52.  
  53.   j={min($hue_min,$hue_max)+(u*(max($hue_min,$hue_max)-min($hue_min,$hue_max)))}
  54.   k={min($sat_min,$sat_max)+(u*(max($sat_min,$sat_max)-min($sat_min,$sat_max)))}
  55.   l={min($val_min,$val_max)+(u*(max($val_min,$val_max)-min($val_min,$val_max)))}
  56.  
  57.   -if {$2}
  58.  
  59.     -if {$4} ch=0 -else ch=2 -endif
  60.  
  61.     -ac  "rr={round(u*255)}
  62.          gg={round(u*255)}
  63.          bb={round(u*255)}
  64.  
  65.          -fx_plasma 0.5,0,{$3},1,1,{$rr},{$gg},{$bb}
  66.          -if {$4} -to_rgba -else ch=2 -to_rgb -endif",{$ch}
  67.  
  68.     -fx_mix_hsv {$j},0,0,{$k},0,0,{$l},0,0,0,2,0
  69.  
  70.   -endif
  71.  
  72.   -fx_gaussian_blur {$5},0,0,1,2,0,0
  73.  
  74.   n_min={$12}
  75.   n_max={$13}
  76.  
  77.   -if {$n_min > $n_max}
  78.     n_min = {$n_min + $n_max}
  79.     n_max = {$n_min - $n_max}
  80.     n_min = {$n_min - $n_max}
  81.   -endif
  82.  
  83.   -if {$6}
  84.  
  85.     p_min={$7}
  86.     p_max={$8}
  87.     h_min={$9}
  88.     h_max={$10}
  89.  
  90.     -if {$p_min > $p_max}
  91.       p_min = {$p_min + $p_max}
  92.       p_max = {$p_min - $p_max}
  93.       p_min = {$p_min - $p_max}
  94.     -endif
  95.  
  96.     -if {$h_min > $h_max}
  97.       h_min = {$h_min + $h_max}
  98.       h_max = {$h_min - $h_max}
  99.       h_min = {$h_min - $h_max}
  100.     -endif
  101.  
  102.     -fx_noise {max(0,round($n_min+(u*($n_max-$n_min))))},{$11},{$14},1,0
  103.     -fx_quadtree 0,{max(2,round($p_min+(u*($p_max-$p_min))))},{max(0,round($h_min+(u*($h_max-$h_min))))},0,3,1.5,1,1,0
  104.     -fx_mix_hsv {$j},0,0,{$k},0,0,{$l},0,0,0,2,0
  105.  
  106.   -endif
  107.  
  108.   -fx_noise {max(0,round($n_min+(u*($n_max-$n_min))))},{$11},{$14},1,0
  109.  
  110.   f={$15} # iterations
  111.   i={$16} # warp intensity
  112.   m={$17} # offset magnitude
  113.   s={$22} # gamma
  114.   v={$23} # hue
  115.  
  116.   -repeat {max(0,$f)}
  117.  
  118.     a=(u-0.5)*$i
  119.     b=(u-0.5)*$i
  120.     c=(u-0.5)*$m*sign($m)
  121.     d=(u-0.5)*$m*sign($m)
  122.     f={round((u*2.98)+0.51)}
  123.     g={round((u*33.98)-0.49)}
  124.     h={(u-0.5)*$s*200}
  125.     o={(u-0.5)*$v*200}
  126.  
  127.     -if {$18==1}
  128.       e=0
  129.     -elif {$18==2}
  130.       e=1
  131.     -else
  132.       e={round(u)}
  133.     -endif
  134.  
  135.     -if {$18==0}
  136.       -fx_warp_by_intensity {$a},{$b},{$c},{$d},{$e},0,{$f},{$g},0
  137.     -else
  138.       -ac  "a={(u-0.5)*$16}
  139.            b={(u-0.5)*$16}
  140.            c={(u-0.5)*$17*sign($17)}
  141.            d={(u-0.5)*$17*sign($17)}
  142.            f={round((u*2.98)+0.51)}
  143.  
  144.            -if {$18==1}
  145.              e=0
  146.            -elif {$18==2}
  147.              e=1
  148.            -else
  149.              e={round(u)}
  150.            -endif
  151.  
  152.         -_fx_warp_by_intensity {$a},{$b},{$c},{$d},{$e},0,{$f}",{$19},0
  153.     -endif
  154.  
  155.  
  156.     -if {$20}
  157.       nn={round(u)}
  158.       -if {$nn}
  159.         -if {$21==0}
  160.           nch={round((u*33.98)-0.49)}
  161.           -ac "-negate",{$nch}
  162.         -else
  163.           -ac "-negate",{$21}
  164.         -endif
  165.       -endif
  166.     -endif
  167.  
  168.     -fx_adjust_colors 0,0,{$h},{$o},0,0
  169.  
  170.   -done
  171.  
  172.   hh=((u-0.5)*360)
  173.   ss=((u-0.5)*2)
  174.   vv=((u-0.5)*2)
  175.  
  176.   -fx_mix_hsv {$j},{$hh},0,{$k},{$ss},0,{$l},{$vv},0,0,2,0
  177.  
  178. fx_ultrawarpplusplusplus:
  179.  
  180.   -ac "-ultrawarpplusplusplus $*",$-2,$-1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement