Advertisement
Guest User

Untitled

a guest
Aug 21st, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. #@gui Cascading self glitching: fx_self_glitching_cascade, fx_self_glitching_cascade_preview(1)
  2. #@gui : Channels = choice("RGB","CMY","CMYK","HSV","HSL","HSI","LCH","YCbCr","YIQ","YUV","HCY","Bayer")
  3. #@gui : Alpha Glitch = bool(0)
  4. #@gui : Zeroth shift = point(50,50)
  5. #@gui : Boundary = choice(3,"Zero","Nearest","Periodic","Mirror")
  6. #@gui : Iterations = int(3,1,10)
  7. #@gui : Power = float(0,-5,5)
  8. #@gui : Bias = float(0,-255,255)
  9. #@gui : Negate = bool(0)
  10. #@gui : Operator = choice("Add","Multiply","Bitwise And","Bitwise Or","Bitwise Xor","Power","Reverse Power","Modulo","Reverse Modulo","Divide","Reverse Divide","Subtract","Reverse Subtract","Left Bitwise Shift", "ReverseLBS", "Right Bitwise Shift", "ReverseRBS","Average","Round","Reverse Round","Sine","Reverse Sine","Cosine","Reverse Cosine","Tangent (CPU-intensive)","Reverse Tangent (CPU-intensive)")
  11. #@gui : First shift target = point(50,50)
  12. #@gui : Cascade centre point = point(50,50)
  13. #@gui : Shift randomness = float(0.75,0,4)
  14. #@gui : Boundary = choice(3,"Zero","Nearest","Periodic","Mirror")
  15. #@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"), Preview split = point(50,50,0,0,200,200,200,0,10,0)
  16. #@gui : sep = separator(), note = note("<small>Author: <i><a href="https://goo.gl/Ryf7Cv">David Tschumperl&#233;</a></i>. Latest update: <i>2018/08/19</i>.</small>")
  17. fx_self_glitching_cascade :
  18. shift {$3-50}%,{$4-50}%,0,0,$5,0
  19. repeat $6
  20. repeat $! l[$>] if {!$2} split_opacity fi l[0]
  21. if {$1==1} rgb2cmy elif {$1==2} rgb2cmyk elif {$1==3} rgb2hsv elif {$1==4} rgb2hsl elif {$1==5} rgb2hsi elif {$1==6} rgb2lch elif {$1==7} rgb2ycbcr elif {$1==8} rgb2yiq elif {$1==9} rgb2yuv elif {$1==10} rgb2hcy elif {$1==11} rgb2bayer 0 fi
  22. f "init(
  23. shift = ([w,h]-1)*([$13,$14]-[$11,$12]+(2*(u-0.5)*sqrt((($13-$11)^2)+(($14-$12)^2))*($15^3)))%;
  24. const sign = $9?-1:1;
  25. const boundary = $16;
  26. );
  27. val = sign*((2^$7)*j(shift) + $8);
  28. ($10==0?(val + i):
  29. $10==1?(val * i):
  30. $10==2?(val & i):
  31. $10==3?(val | i):
  32. $10==4?xor(val,i):
  33. $10==5?(val^i):
  34. $10==6?(i^val):
  35. $10==7?(val%i):
  36. $10==8?(i%val):
  37. $10==9?(val / i):
  38. $10==10?(i / val):
  39. $10==11?(i - val):
  40. $10==12?(val - i):
  41. $10==13?(val << i):
  42. $10==14?(i << val):
  43. $10==15?(val >> i):
  44. $10==16?(i >> val):
  45. $10==17?avg(i,val):
  46. $10==18?round(val,i,0):
  47. $10==19?round(i,val,0):
  48. $10==20?i*sin(val*2*pi/255):
  49. $10==21?val*sin(i*2*pi/255):
  50. $10==22?i*cos(val*2*pi/255):
  51. $10==23?val*cos(i*2*pi/255):
  52. $10==24?(i*tan(val*pi/255)):
  53. (val*tan(i*pi/255))
  54. )%255;
  55. "
  56. if {$1==1} cmy2rgb elif {$1==2} cmyk2rgb elif {$1==3} hsv2rgb elif {$1==4} hsl2rgb elif {$1==5} rgb2hsi elif {$1==6} lch2rgb elif {$1==7} ycbcr2rgb elif {$1==8} yiq2rgb elif {$1==9} yuv2rgb elif {$1==10} hcy2rgb elif {$1==11} bayer2rgb 0,0,0 fi
  57. endl a c endl done done
  58. fx_self_glitching_cascade_preview :
  59. fx_self_glitching_cascade $*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement