Advertisement
Guest User

Untitled

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