Advertisement
Guest User

Untitled

a guest
Jun 30th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.36 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>Deformations</b>
  13.  
  14. #@gui UltraWarp++ : fx_ultrawarpplusplus, fx_ultrawarpplusplus(1)
  15. #@gui : note = note("[Optional plasma texture generation and quadtree pixelisation or blurring followed by] random warp with gamma and hue randomisation and final HSV scaling"), sep = separator()
  16. #@gui : Refresh = bool(0)
  17. #@gui : sep = separator()
  18. #@gui : Plasma Texture = bool(0)
  19. #@gui : Plasma Scale = float(5,0,20)
  20. #@gui : sep = separator()
  21. #@gui : Blur = float (0,0,30)
  22. #@gui : sep = separator()
  23. #@gui : Quadtree Pixelisation = bool(0)
  24. #@gui : Quadtree Min Precision = int(128,2,2048)
  25. #@gui : Quadtree Max Precision = int(1024,0,2048)
  26. #@gui : Quadtree Min Homogeneity = float(0,0,5)
  27. #@gui : Quadtree Max Homogeneity = float(5,0,5)
  28. #@gui : Minimum Noise = float(0,0,100)
  29. #@gui : Maximum Noise = float(2.5,0,100)
  30. #@gui : sep = separator(), note = note("<small>Warping Loop</small>")
  31. #@gui : Warp Iterations = int(5,0,30)
  32. #@gui : Warp Intensity = float(3,0,30)
  33. #@gui : Warp Offset = int(5,0,2000)
  34. #@gui : Correlated Channels = choice("Random","Off","On")
  35. #@gui : 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]")
  36. #@gui : Gamma Offset = float(0.25,0,1)
  37. #@gui : Hue Offset = float(1,0,1)
  38. #@gui : sep = separator(), note = note("<small>Final HSV Scaling</small>")
  39. #@gui : Minimum Hue = float(0,0,20)
  40. #@gui : Maximum Hue = float(5,0,20)
  41. #@gui : Minimum Saturation = float(0.5,0,20)
  42. #@gui : Maximum Saturation = float(5,0,20)
  43. #@gui : Minimum Value = float(0,0,20)
  44. #@gui : Maximum Value = float(5,0,20)
  45. #@gui : sep = separator(), 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]")
  46. #@gui : Value action = choice("None","Cut","Normalize")
  47.  
  48. ultrawarpplusplus:
  49.  
  50. # plasma rendering and pixelisation followed by random warp with gamma and hue randomisation and final HSV scaling
  51.  
  52. p_min={$6}
  53. p_max={$7}
  54. h_min={$8}
  55. h_max={$9}
  56. n_min={$10}
  57. n_max={$11}
  58.  
  59. -if {$2}
  60.  
  61.   -if {$p_min > $p_max}
  62.     p_min = {$p_min + $p_max}
  63.     p_max = {$p_min - $p_max}
  64.     p_min = {$p_min - $p_max}
  65.   -endif
  66.  
  67.   -if {$h_min > $h_max}
  68.     h_min = {$h_min + $h_max}
  69.     h_max = {$h_min - $h_max}
  70.     h_min = {$h_min - $h_max}
  71.   -endif
  72.  
  73.   -if {$n_min > $n_max}
  74.     n_min = {$n_min + $n_max}
  75.     n_max = {$n_min - $n_max}
  76.     n_min = {$n_min - $n_max}
  77.   -endif
  78.  
  79.   rr={round(u*255)}
  80.   gg={round(u*255)}
  81.   bb={round(u*255)}
  82.  
  83.   -fx_plasma 0.5,10,{$3},1,0,{$rr},{$gg},{$bb}
  84.  
  85. -endif
  86.  
  87. -fx_gaussian_blur {$4},0,0,1,2,0,0
  88.  
  89. -if {$5}
  90.   -fx_noise {max(0,round($n_min+(u*($n_max-$n_min))))},2,2,1,0
  91.   -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
  92. -endif
  93.  
  94. -fx_noise {max(0,round($n_min+(u*($n_max-$n_min))))},2,2,1,0
  95.  
  96. f={$12} # iterations
  97. i={$13} # warp intensity
  98. m={$14} # offset magnitude
  99. s={$17} # gamma
  100. v={$18} # hue
  101.  
  102. hue_min={$19}
  103. hue_max={$20}
  104. sat_min={$21}
  105. sat_max={$22}
  106. val_min={$23}
  107. val_max={$24}
  108.  
  109. j={min($hue_min,$hue_max)+(u*(max($hue_min,$hue_max)-min($hue_min,$hue_max)))}
  110. k={min($sat_min,$sat_max)+(u*(max($sat_min,$sat_max)-min($sat_min,$sat_max)))}
  111. l={min($val_min,$val_max)+(u*(max($val_min,$val_max)-min($val_min,$val_max)))}
  112.  
  113. -repeat {max(0,$f)}
  114.  
  115.   a=(u-0.5)*$i
  116.   b=(u-0.5)*$i
  117.   c=(u-0.5)*$m*sign($m)
  118.   d=(u-0.5)*$m*sign($m)
  119.   f={round((u*2.98)+0.51)}
  120.   g={round((u*33.98)-0.49)}
  121.   h={(u-0.5)*$s*200}
  122.   m={(u-0.5)*$v*200}
  123.  
  124.   -if {$15==1}
  125.     e=0
  126.   -elif {$15==2}
  127.     e=1
  128.   -else
  129.     e={round(u)}
  130.   -endif
  131.  
  132.   -if {$16==0}
  133.     -fx_warp_by_intensity {$a},{$b},{$c},{$d},{$e},0,{$f},{$g},0
  134.   -else
  135.     -ac " a={(u-0.5)*$13}
  136.          b={(u-0.5)*$13}
  137.          c={(u-0.5)*$14*sign($14)}
  138.          d={(u-0.5)*$14*sign($14)}
  139.          f={round((u*2.98)+0.51)}
  140.  
  141.          -if {$15==1}
  142.            e=0
  143.          -elif {$15==2}
  144.            e=1
  145.          -else
  146.            e={round(u)}
  147.          -endif
  148.  
  149.          -_fx_warp_by_intensity {$a},{$b},{$c},{$d},{$e},0,{$f}",{$16}
  150.   -endif
  151.  
  152.   -fx_adjust_colors 0,0,{$h},{$m},0,0
  153.  
  154. -done
  155.  
  156. -fx_mix_hsv {$j},0,0,{$k},0,0,{$l},0,0,0,2,0
  157.  
  158. fx_ultrawarpplusplus:
  159.  
  160.   -ac "-ultrawarpplusplus $*",$-2,$-1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement