Advertisement
Guest User

done

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