Advertisement
Guest User

Untitled

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