SHARE
TWEET

Code for Vibrato Advanced Texture

a guest Dec 16th, 2018 76 in 21 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #@gui Vibrato Texture Advanced: fx_vibrato_texture_advanced, fx_vibrato_texture_advanced_preview(0)
  2. #@gui : note = note("This is an advanced version of the regular Vibrato Texture. You can create vibrato texture alongside multiple channels at once within several different color space except CMY/CMYK. This filter is inspired by the Paint.NET plugin named Vibrato authored by MadJik for Paint.NET.")
  3. #@gui : sep = separator()
  4. #@gui : 1. Use Colour Space Model = choice("RGB/sRGB","HSV/HSV8","HSL/HSL8","HSI/HSI8","LCH/LCH8","Lab/Lab8","YCbCr/YCbCrGLIC","YIQ/YIQ8","YUV/YUV8","Bayer/HCY","XYZ/XYZ8")
  5. #@gui : 2. Alternative Colour Space Model Choice = bool(0)
  6. #@gui : sep = separator()
  7. #@gui : note = note(<b> - Channel #1 Variables- </b>)
  8. #@gui : 3. X-Orientation = bool(1)
  9. #@gui : 4. Y-Orientation = bool(1)
  10. #@gui : 5. U- Factor = float(.85,.1,15)
  11. #@gui : 6. V- Factor = float(.85,.1,15)
  12. #@gui : 7. X-Scale Factor = float(1,.1,15)
  13. #@gui : 8. Y-Scale Factor = float(1,.1,15)
  14. #@gui : 9. XY-Scale Factor = float(1,.1,3)
  15. #@gui : 10. Percentage-Based X Pixel Shift = float(0,-200,200)
  16. #@gui : 11. Percentage-Based Y Pixel Shift = float(0,-200,200)
  17. #@gui : 12. Elevation = float(.7,-1,1)
  18. #@gui : 13. Z 0-1 Multiplier = float(.5,0.1,1)
  19. #@gui : 14. Z Exponential Multiplier = float(1,1,15)
  20. #@gui : 15. Apply Inversion Factor = bool(0)
  21. #@gui : 16. Inversion Factor = float(1,-1,10)
  22. #@gui : 17. Final Mod Factor = float(1,1,32)
  23. #@gui : 18. Invert Vibrato = bool(0)
  24. #@gui : 19. Image Influence Factor = float(1,-8,8)
  25. #@gui : sep = separator()
  26. #@gui : note = note(<b> - Channel #1 Variables- </b>)
  27. #@gui : 20. X-Orientation = bool(1)
  28. #@gui : 21. Y-Orientation = bool(1)
  29. #@gui : 22. U- Factor = float(.85,.1,15)
  30. #@gui : 23. V- Factor = float(.85,.1,15)
  31. #@gui : 24. X-Scale Factor = float(1,.1,15)
  32. #@gui : 25. Y-Scale Factor = float(1,.1,15)
  33. #@gui : 26. XY-Scale Factor = float(1,.1,3)
  34. #@gui : 27. Percentage-Based X Pixel Shift = float(0,-200,200)
  35. #@gui : 28. Percentage-Based Y Pixel Shift = float(0,-200,200)
  36. #@gui : 29. Elevation = float(.7,-1,1)
  37. #@gui : 30. Z 0-1 Multiplier = float(.5,0.1,1)
  38. #@gui : 31. Z Exponential Multiplier = float(1,1,15)
  39. #@gui : 32. Apply Inversion Factor = bool(0)
  40. #@gui : 33. Inversion Factor = float(1,-1,10)
  41. #@gui : 34. Final Mod Factor = float(1,1,32)
  42. #@gui : 35. Invert Vibrato = bool(0)
  43. #@gui : 36. Image Influence Factor = float(1,-8,8)
  44. #@gui : sep = separator()
  45. #@gui : note = note(<b> - Channel #1 Variables- </b>)
  46. #@gui : 37. X-Orientation = bool(1)
  47. #@gui : 38. Y-Orientation = bool(1)
  48. #@gui : 39. U- Factor = float(.85,.1,15)
  49. #@gui : 40. V- Factor = float(.85,.1,15)
  50. #@gui : 41. X-Scale Factor = float(1,.1,15)
  51. #@gui : 42. Y-Scale Factor = float(1,.1,15)
  52. #@gui : 43. XY-Scale Factor = float(1,.1,3)
  53. #@gui : 44. Percentage-Based X Pixel Shift = float(0,-200,200)
  54. #@gui : 45. Percentage-Based Y Pixel Shift = float(0,-200,200)
  55. #@gui : 46. Elevation = float(.7,-1,1)
  56. #@gui : 47. Z 0-1 Multiplier = float(.5,0.1,1)
  57. #@gui : 48. Z Exponential Multiplier = float(1,1,15)
  58. #@gui : 49. Apply Inversion Factor = bool(0)
  59. #@gui : 50. Inversion Factor = float(1,-1,10)
  60. #@gui : 51. Final Mod Factor = float(1,1,32)
  61. #@gui : 52. Invert Vibrato = bool(0)
  62. #@gui : 53. Image Influence Factor = float(1,-8,8)
  63. #@gui : sep = separator()
  64. #@gui : note = note(<b> - Alpha Variables- </b>)
  65. #@gui : 54. X-Orientation = bool(1)
  66. #@gui : 55. Y-Orientation = bool(1)
  67. #@gui : 56. U- Factor = float(.85,.1,15)
  68. #@gui : 57. V- Factor = float(.85,.1,15)
  69. #@gui : 58. X-Scale Factor = float(1,.1,15)
  70. #@gui : 59. Y-Scale Factor = float(1,.1,15)
  71. #@gui : 60. XY-Scale Factor = float(1,.1,3)
  72. #@gui : 61. Percentage-Based X Pixel Shift = float(0,-200,200)
  73. #@gui : 62. Percentage-Based Y Pixel Shift = float(0,-200,200)
  74. #@gui : 63. Elevation = float(.7,-1,1)
  75. #@gui : 64. Z 0-1 Multiplier = float(.5,0.1,1)
  76. #@gui : 65. Z Exponential Multiplier = float(1,1,15)
  77. #@gui : 66. Apply Inversion Factor = bool(0)
  78. #@gui : 67. Inversion Factor = float(1,-1,10)
  79. #@gui : 68. Final Mod Factor = float(1,1,32)
  80. #@gui : 69. Invert Vibrato = bool(0)
  81. #@gui : 70. Image Influence Factor = float(1,-8,8)
  82. #@gui : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical","Duplicate top","Duplicate left","Duplicate bottom","Duplicate right","Duplicate horizontal","Duplicate vertical","Checkered","Checkered inverse")
  83. #@gui : sep = separator(), note = note("<small>Author : <i>Reptorian</i>.      Latest update : <i>2018/09/26</i>.</small>")
  84.  
  85. _fx_vibrato_texture_advanced:
  86. repeat $! l[$>]
  87. #if {x+$3}
  88. n 0,255 f "q=($10/100)*w;
  89. l=($11/100)*h;
  90. X=(($3?w-x+q:x+q)/w-.5) * 2 * 1/$7 * 1/$9;
  91. Y=(($4?h-y+l:y+l)/h-.5) * 2 * 1/$8 * 1/$9;
  92. g=1*13^(-$16);
  93. U=sqrt($5);
  94. V=sqrt($6);
  95. Z=((X-Y) * (X-U) * (X+U) * (Y-V) * (Y+V))+ $12;
  96. D=$15?(1-(Z>g?Z:1-Z * -1)):Z;
  97. C=(D+((1-i/255)/(($5>1?$5:1/$5)*($6>1?$6:1/$6)))*$19)*(D+((1-i/255)/(($5>1?$5:1/$5)*($6>1?$6:1/$6)))*$19)*$13*$14*$14;
  98. F=abs(C)>1?C-int(C):C;
  99. $18?F:1-F;
  100. " n 0,255 mul $17 mod 256
  101. # fi
  102. endl done
  103.  
  104. fx_vibrato_texture:
  105. if {$2}
  106. if {$1==0} rgb2srgb
  107. elif {$1==1} rgb2cmy
  108. elif {$1==2} rgb2hsv8
  109. elif {$1==3} rgb2hsl8
  110. elif {$1==4} rgb2hsi8
  111. elif {$1==5} rgb2lch8
  112. elif {$1==6} rgb2lab8
  113. elif {$1==7} rgb2ycbcrglic
  114. elif {$1==8} rgb2yiq8
  115. elif {$1==9} rgb2yuv8
  116. elif {$1==10} rgb2hcy
  117. elif {$1==11} rgb2xyz8
  118. fi else
  119. if {$1==1} rgb2cmyk
  120. elif {$1==2} rgb2hsv
  121. elif {$1==3} rgb2hsl
  122. elif {$1==4} rgb2hsi
  123. elif {$1==5} rgb2lch
  124. elif {$1==6} rgb2lab
  125. elif {$1==7} rgb2ycbcr
  126. elif {$1==8} rgb2yiq
  127. elif {$1==9} rgb2yuv
  128. elif {$1==10} rgb2bayer 0
  129. elif {$1==11} rgb2xyz
  130. fi fi
  131.  
  132. _fx_vibrato_texture_advanced
  133. . 128 s. c
  134. *... $3 +... $4 +... $5 +... $6 +... $7 +... $8 +... $9 +... $10 +... $11 +... $12 +... $13 +... $14 +...$15 +... $16 +... $17 +... $18 b... $19%
  135.  
  136. *.. $20 +.. $21 +.. $22 +.. $23 +.. $24 +..$25 +.. $26 +.. $27 +.. $28 +.. $29 +.. $30 +.. $31 +..$32 +..$33 +.. $34 +.. $35 b.. $36%
  137.  
  138. *. $37 +. $38 +. $39 +. $40 +. $41 +.$42 +. $43 +. $44 +. $45 +. $46 +.$47 +. $48 +.$49 +.$50 +. $51 +..$52 b.. $53%
  139.  
  140. *.... $54 +.... $55 +.... $56 +.... $57 +.... $58 +.... $59 +.... $60 +.... $61 +.... $62 +.... $63 +.... $64 +.... $65 +.... $66 +.... $67 +.... $68 +.... $69 b.... $70%
  141.  
  142. fi
  143. if {$2}
  144. if {$1==0} srgb2rgb
  145. elif {$1==1} cmy2rgb
  146. elif {$1==2} hsv82rgb
  147. elif {$1==3} hsl82rgb
  148. elif {$1==4} hsi82rgb
  149. elif {$1==5} lch82rgb
  150. elif {$1==6} lab82rgb
  151. elif {$1==7} ycbcrglic2rgb
  152. elif {$1==8} yiq82rgb
  153. elif {$1==9} yuv82rgb
  154. elif {$1==10} hcy2rgb
  155. elif {$1==11} xyz82rgb
  156. fi else
  157. if {$1==1} cmyk2rgb
  158. elif {$1==2} hsv2rgb
  159. elif {$1==3} hsl2rgb
  160. elif {$1==4} hsi2rgb
  161. elif {$1==5} lch2rgb
  162. elif {$1==6} lab2rgb
  163. elif {$1==7} ycbcr2rgb
  164. elif {$1==8} yiq2rgb
  165. elif {$1==9} yuv2rgb
  166. elif {$1==10} bayer2rgb 0,0,0
  167. elif {$1==11} xyz2rgb
  168. fi fi
  169. a[-3--1] c +. 128 c. 0,255
  170.  
  171. fx_vibrato_texture_advanced_preview :
  172. gui_split_preview "fx_vibrato_texture_advanced ${1--2}",$-1
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top