Guest User

uw4+ again

a guest
Jul 3rd, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.63 KB | None | 0 0
  1. #@gui UltraWarp++++ : fx_ultrawarp4plus, fx_ultrawarp4plus_preview(1)
  2. #@gui : note = note("A sequence of multiple partially-randomised texture generation and image deformation filters with multi-iteration warping.")
  3. #@gui : note = note("<small>This modular filter is extremely complex and its logic may not follow that which you expect. Left on its default settings, it is very likely to munge your image beyond recognition. This original version has been kept alive despite being slower than UltraWarp 2.</small>"), sep = separator()
  4. #@gui : 0. Recompute = button(0)
  5. #@gui : sep = separator()
  6. #@gui : 1. Plasma Texture [Discards Input Image] = bool(0)
  7. #@gui : 2. Plasma Scale = float(3.3,0,20)
  8. #@gui : 3. Plasma Alpha Channel = bool(0)
  9. #@gui : sep = separator()
  10. #@gui : 4. Segmentation [No Alpha Channel] = bool(0)
  11. #@gui : 5. Edge Threshold = float (5,0.01,60)
  12. #@gui : 6. Smoothness = float (0,0,60)
  13. #@gui : sep = separator()
  14. #@gui : 7. Blur = float (0,0,30)
  15. #@gui : sep = separator()
  16. #@gui : 8. Quadtree Pixelisation [No Alpha Channel] = bool(0)
  17. #@gui : 9. Quadtree Min Precision = int(4,2,8192)
  18. #@gui : 10. Quadtree Max Precision = int(256,0,8192)
  19. #@gui : 11. Quadtree Min Homogeneity = float(4.8,0,5)
  20. #@gui : 12. Quadtree Max Homogeneity = float(5,0,5)
  21. #@gui : sep = separator()
  22. #@gui : 13. Noise Type = choice(2,"Gaussian","Uniform","Salt and pepper","Poisson")
  23. #@gui : 14. Minimum Noise = float(0,0,8)
  24. #@gui : 15. Maximum Noise = float(0,0,8)
  25. #@gui : 16. 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]")
  26. #@gui : sep = separator(), note = note("<small>Warping</small>")
  27. #@gui : 17. Warp Iterations = int(3,0,30)
  28. #@gui : 18. Warp Intensity = float(3,0,10)
  29. #@gui : 19. Warp Offset = float(20,0,2000)
  30. #@gui : 20. Scale to Width = bool(1)
  31. #@gui : 21. Scale to Height = bool(1)
  32. #@gui : 22. Correlated Channels = choice("Random","Off","On")
  33. #@gui : 23. Boundary = choice(5,"Random","Random [non-transparent]","Transparent","Nearest","Periodic", "Mirror")
  34. #@gui : 24. 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]")
  35. #@gui : 25. Random Negation = bool(1)
  36. #@gui : 26. 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]")
  37. #@gui : 27. Gamma Offset = float(0.25,0,1)
  38. #@gui : 28. Hue Offset = float(1,0,1)
  39. #@gui : 29. Normalise = bool(1)
  40. #@gui : sep = separator(), note = note("<small>Final HSV Scaling</small>")
  41. #@gui : 30. Minimum Hue = float(0,0,20)
  42. #@gui : 31. Maximum Hue = float(5,0,20)
  43. #@gui : 32. Minimum Saturation = float(0,0,20)
  44. #@gui : 33. Maximum Saturation = float(3,0,20)
  45. #@gui : 34. Minimum Value = float(0.5,0,20)
  46. #@gui : 35. Maximum Value = float(2,0,20)
  47. #@gui : note = note("<small>Set these to their minimum values for randomisation</small>")
  48. #@gui : 36. Hue Offset = float(-180, -180, 180)
  49. #@gui : 37. Saturation Offset = float(0, -1.01, 1)
  50. #@gui : 38. Value Offset = float(0,-20.01,20)
  51. #@gui : sep = separator(),
  52. #@gui : -4. Normalise = bool(1)
  53. #@gui : -3. Normalisation Channel(s) = choice(11,"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]")
  54. #@gui : sep = separator(),
  55. #@gui : -2. UltraWarp++++ 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]")
  56. #@gui : -1. Value Action = choice("None","Cut","Normalize")
  57. ultrawarp4plus:
  58. hue_min={$30}
  59. hue_max={$31}
  60. sat_min={$32}
  61. sat_max={$33}
  62. val_min={$34}
  63. val_max={$35}
  64. j={min($hue_min,$hue_max)+(u*(max($hue_min,$hue_max)-min($hue_min,$hue_max)))}
  65. k={min($sat_min,$sat_max)+(u*(max($sat_min,$sat_max)-min($sat_min,$sat_max)))}
  66. l={min($val_min,$val_max)+(u*(max($val_min,$val_max)-min($val_min,$val_max)))}
  67. if {$1}
  68. if {$2} ch=0 else ch=2 fi
  69. ac "rr={round(u*255)}
  70. gg={round(u*255)}
  71. bb={round(u*255)}
  72. fx_plasma 0.5,0,{$2},1,1,{$rr},{$gg},{$bb}
  73. if {$3} to_rgba else ch=2 to_rgb fi",{$ch} fi
  74. fx_gaussian_blur {$7},0,0,1,2,0,0
  75. n_min=$14
  76. n_max=$15
  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. fi
  82. noise_exp={max(0,$n_min+(u*($n_max-$n_min)))}
  83. n_amt={(2^($noise_exp-3))*$noise_exp}
  84. if {$4} fx_segment_watershed {$5},{$6},0,2,0 fi
  85. if {$8}
  86. p_min={$9}
  87. p_max={$10}
  88. h_min={$11}
  89. h_max={$12}
  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. fi
  95. if $h_min>$h_max
  96. h_min=$h_min + $h_max
  97. h_max=$h_min - $h_max
  98. h_min=$h_min - $h_max
  99. fi
  100. ac "noise "$n_amt",$13",$16,1
  101. 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
  102. fi
  103. ac "noise "$n_amt",$13",$16,1
  104. f={$17}
  105. i={$18}
  106. m={$19}
  107. s={$27}
  108. v={$28}
  109. repeat {max(0,$f)}
  110. if {$20}
  111. scale_x=w/10
  112. a={((2^($18-5))*$18)*(u-0.5)*$scale_x*0.025}
  113. else
  114. scale_x=1
  115. a={((2^($18-5))*$18)*(u-0.5)}
  116. fi
  117. if {$22}
  118. scale_y=h/10
  119. b={((2^($18-5))*$18)*(u-0.5)*$scale_y*0.025}
  120. else
  121. scale_y=1
  122. b={((2^($18-5))*$18)*(u-0.5)}
  123. fi
  124. c=(u-0.5)*$m*sign($m)*$scale_x
  125. d=(u-0.5)*$m*sign($m)*$scale_y
  126. g={round((u*33.98)-0.49)}
  127. h={u(-100,100)}
  128. o={u(-100,100)}
  129. if {$22==1}
  130. e=0
  131. elif {$22==2}
  132. e=1
  133. else
  134. e={round(u)}
  135. fi
  136. if {$23==0}
  137. f={round((u*2.98)-0.49)}
  138. elif {$23==1}
  139. f={round((u*2.98)+0.51)}
  140. else
  141. f={($23)-2}
  142. fi
  143. ac "_fx_warp_by_intensity "{$a}","{$b}","{$c}","{$d}","{$e}",0,"{$f}"",{$24},0
  144. if {$25}
  145. nn={round(u)}
  146. if {$nn}
  147. if {$26==0}
  148. nch={round((u*33.98)-0.49)}
  149. ac "negate",{$nch}
  150. else
  151. ac "negate",{$26}
  152. fi
  153. fi
  154. fi
  155. fx_adjust_colors 0,0,{$h},{$o},0,0
  156. if {$29}
  157. ac "n 0,255",3
  158. fi
  159. done
  160. if {$36==-180}
  161. hh=((u-0.5)*360)
  162. else
  163. hh={$36}
  164. fi
  165. if {$37==-8.01}
  166. ss=((u-0.5)*2)
  167. else
  168. ss={$37}
  169. fi
  170. if {$38==-20.01}
  171. vv=((u-0.5)*2)
  172. else
  173. vv={$38}
  174. fi
  175. fx_mix_hsv {$j},{$hh},0,{$k},{$ss},0,{$l},{$vv},0,0,2,0
  176. if {$-2}
  177. ac "n 0,255",{$-1}
  178. fi
  179. fx_ultrawarp4plus:
  180. repeat $! l[$>]
  181. ac "ultrawarp4plus ${2--3}",$-2,$-1
  182. fx_adjust_colors 0,0,0,{(u-0.5)*200},0,0
  183. endl done
  184. fx_ultrawarp4plus_preview:
  185. fx_ultrawarp4plus $*
Advertisement
Add Comment
Please, Sign In to add comment