daily pastebin goal
90%
SHARE
TWEET

Untitled

a guest Aug 27th, 2018 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #@gui Cascading self glitching: fx_self_glitching_cascade, fx_self_glitching_cascade_preview(1)
  2. #@gui : note = note("Shifts images in a cascading fashion but computes values based on shifted and original images.")
  3. #@gui : note = note("<small>This filter many channel options and many operation options allowing for extremely-distorted images. Don't always trust the preview!</small>"), sep = separator()
  4. #@gui : 1. Shift channels = choice("RGB&#47;sRGB","CMYK&#47;CMY","HSV&#47;HSV8","HSL&#47;HSL8","HSI&#47;HSI8","LCH&#47;LCH8","Lab&#47;Lab8","YCbCr&#47;YCbCr_2","YIQ&#47;YIQ8","YUV&#47;YUV8","Bayer&#47;INT24","XYZ&#47;XYZ8")
  5. #@gui : 2. Alt choice = bool(0)
  6. #@gui : 3. Process Alpha = bool(0)
  7. #@gui : 4,5. Zeroth shift = point(50,50,0,1,255,255,255,175)
  8. #@gui : 6. Boundary = choice(3,"Zero","Nearest","Periodic","Mirror")
  9. #@gui : sep = separator()
  10. #@gui : 7. Iterations = int(3,1,32)
  11. #@gui : 8. Repeat post-shift operations = bool(0)
  12. #@gui : sep = separator()
  13. #@gui : 9,10. Shift target = point(55,55,0,1,255,0,0,175)
  14. #@gui : 11. Target for final &#40;rather than first&#41; shift = bool(0)
  15. #@gui : 12,13. Cascade centre point = point(45,45,0,1,0,255,0,175)
  16. #@gui : 14. Shift randomness = float(0.75,0,4)
  17. #@gui : 15. Boundary = choice(3,"Zero","Nearest","Periodic","Mirror")
  18. #@gui : 16. Power = float(0,-5,5)
  19. #@gui : 17. Bias = float(0,-256,256)
  20. #@gui : 18. Negation = bool(0)
  21. #@gui : 19. 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","Reverse LBS","Right Bitwise Shift","Reverse RBS","Left Bitwise Rotation","Reverse LBR","Right Bitwise Rotation","Reverse RBR","Average","Round","Reverse Round","Sine","Reverse Sine","Cosine","Reverse Cosine","Tangent","Reverse Tangent &#40;CPU-intensive&#41;","Cosecant","Reverse Cosecant","Secant","Reverse Secant","Cotangent","Reverse Cotangent","Variance","Difference","Minimum","Maximum","Interference &#40;Add&#41;","Reverse Interference &#40;Add&#41;","Interference &#40;Multiply&#41;","Interference &#40;Divide&#41;","Reverse Interference &#40;Div&#41;","Interference &#40;Subtract&#41;","Reverse Interference &#40;Subt&#41;","Interference &#40;Rev Subt&#41;","Reverse Interference &#40;Rev Subt&#41;","Interference &#40;Difference&#41;","Reverse Interference &#40;Diff&#41;","Interference &#40;Variance&#41;")
  22. #@gui : 20. Multiplier 1 = float(1,0,10)
  23. #@gui : 21. Addition 1 = int(0,-1024,1024)
  24. #@gui : 22. Post-Shift Modulo = int(256,1,1024)
  25. #@gui : 23. Multiplier 2 = float(1,0,10)
  26. #@gui : 24. Addition 2 = int(0,-1024,1024)
  27. #@gui : sep = separator(), 25. Run on 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]")
  28. # #@gui : sep = separator(), 26. 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)
  29. #@gui : sep = separator(), note = note("<small>Original author: <i><a href="https://goo.gl/Ryf7Cv">David Tschumperl&#233;</a></i>&#59; extended by some nobody who calls themselves 'Joan Rake' or something.<p>Latest update: <i>2018/08/24</i>.</small>")
  30. fx_self_glitching_cascade :
  31. shift {$4-50}%,{$5-50}%,0,0,$6,0
  32. repeat $! l[$>] if {!$3} split_opacity fi l[0] to_rgb
  33. if {$2}
  34. if {$1==0} rgb2srgb
  35. elif {$1==1} rgb2cmy
  36. elif {$1==2} rgb2hsv8
  37. elif {$1==3} rgb2hsl8
  38. elif {$1==4} rgb2hsi8
  39. elif {$1==5} rgb2lch8
  40. elif {$1==6} rgb2lab8
  41. elif {$1==7} rgb2ycbcr_2
  42. elif {$1==8} rgb2yiq8
  43. elif {$1==9} rgb2yuv8
  44. elif {$1==10} rgb2int
  45. elif {$1==11} rgb2xyz8
  46. fi else
  47. if {$1==1} rgb2cmyk
  48. elif {$1==2} rgb2hsv
  49. elif {$1==3} rgb2hsl
  50. elif {$1==4} rgb2hsi
  51. elif {$1==5} rgb2lch
  52. elif {$1==6} rgb2lab
  53. elif {$1==7} rgb2ycbcr
  54. elif {$1==8} rgb2yiq
  55. elif {$1==9} rgb2yuv
  56. elif {$1==10} rgb2bayer 0
  57. elif {$1==11} rgb2xyz
  58. fi fi
  59. iter=0
  60. repeat $7
  61. iter={$iter+1}
  62. f "init(
  63. const stype = $11?$7:1;
  64. shift = ((([w,h]-1)*([$12,$13]-[$9,$10]+[u(-1,1),u(-1,1)]*sqrt((($12-$9)^2)+(($13-$10)^2))*($14^3)))/stype)%;
  65. const sign = $18?-1:1;
  66. const boundary = $15;
  67. );
  68. val = sign*((2^$16)*j(shift) + $17);
  69. ($19==0?(val + i):
  70. $19==1?(val * i):
  71. $19==2?(val & i):
  72. $19==3?(val | i):
  73. $19==4?xor(val,i):
  74. $19==5?(val^i):
  75. $19==6?(i^val):
  76. $19==7?(val%i):
  77. $19==8?(i%val):
  78. $19==9?(val / i):
  79. $19==10?(i / val):
  80. $19==11?(i - val):
  81. $19==12?(val - i):
  82. $19==13?(val << i):
  83. $19==14?(i << val):
  84. $19==15?(val >> i):
  85. $19==16?(i >> val):
  86. $19==17?for(n=0,n<(i%32),n++,rol(val)):
  87. $19==18?for(n=0,n<(val%32),n++,rol(i)):
  88. $19==19?for(n=0,n<(i%32),n++,ror(val)):
  89. $19==20?for(n=0,n<(val%32),n++,ror(i)):
  90. $19==21?avg(i,val):
  91. $19==22?round(val,i,0):
  92. $19==23?round(i,val,0):
  93. $19==24?i*sin(val*2*pi/$20):
  94. $19==25?val*sin(i*2*pi/$20):
  95. $19==26?sign*i*cos(val*2*pi/$20):
  96. $19==27?sign*val*cos(i*2*pi/$20):
  97. $19==28?i*tan(val*pi/$20):
  98. $19==29?val*tan(i*pi/$20):
  99. $19==30?i*sin($20/(val*2*pi)):
  100. $19==31?val*sin($20/(i*2*pi)):
  101. $19==32?sign*i*cos($20/(val*2*pi)):
  102. $19==33?sign*val*cos($20/(i*2*pi)):
  103. $19==34?i*tan($20/(val*pi)):
  104. $19==35?val*tan($20/(i*pi)):
  105. $19==36?$20*var(val,i):
  106. $19==37?abs(i - val):
  107. $19==38?min(i,val):
  108. $19==39?max(i,val):
  109. $19==40?0.005*i*(((j(0,0,0,(c+1)%(s(#0)-1)+1)*2^$16))+val):
  110. $19==41?0.005*val*((j(0,0,0,(c+1)%(s(#0)-1)+1)*2^$16)+i):
  111. $19==42?0.1*i*(j(0,0,0,(c+1)%(s(#0)-1)+1)*2^$16)*val:
  112. $19==43?0.1*i*(j(0,0,0,(c+1)%(s(#0)-1)+1)*2^$16)/val:
  113. $19==44?0.1*val*(j(0,0,0,(c+1)%(s(#0)-1)+1)*2^$16)/i:
  114. $19==45?0.001*i*((j(0,0,0,(c+1)%(s(#0)-1)+1)*2^$16)-val):
  115. $19==46?0.001*val*((j(0,0,0,(c+1)%(s(#0)-1)+1)*2^$16)-i):
  116. $19==47?0.001*i*(val-(j(0,0,0,(c+1)%(s(#0)-1)+1)*2^$16)):
  117. $19==48?0.001*val*(i-(j(0,0,0,(c+1)%(s(#0)-1)+1)*2^$16)):
  118. $19==49?0.001*i*abs((j(0,0,0,(c+1)%(s(#0)-1)+1)*2^$16)-val):
  119. $19==50?0.001*val*abs((j(0,0,0,(c+1)%(s(#0)-1)+1)*2^$16)-i):
  120. 0.00001*$20*var(val,i,(j(0,0,0,(c+1)%(s(#0)-1)+1)*2^$16))
  121. );$8||$iter==$7?val*$20+$21%$22*$23+$24;"
  122. if {$2}
  123. if {$1==0} srgb2rgb
  124. elif {$1==1} cmy2rgb
  125. elif {$1==2} hsv82rgb
  126. elif {$1==3} hsl82rgb
  127. elif {$1==4} hsi82rgb
  128. elif {$1==5} lch82rgb
  129. elif {$1==6} lab82rgb
  130. elif {$1==7} ycbcr_22rgb
  131. elif {$1==8} yiq82rgb
  132. elif {$1==9} yuv82rgb
  133. elif {$1==10} int2rgb
  134. elif {$1==11} xyz82rgb
  135. fi else
  136. if {$1==1} cmyk2rgb
  137. elif {$1==2} hsv2rgb
  138. elif {$1==3} hsl2rgb
  139. elif {$1==4} hsi2rgb
  140. elif {$1==5} lch2rgb
  141. elif {$1==6} lab2rgb
  142. elif {$1==7} ycbcr2rgb
  143. elif {$1==8} yiq2rgb
  144. elif {$1==9} yuv2rgb
  145. elif {$1==10} bayer2rgb 0,0,0
  146. elif {$1==11} xyz2rgb
  147. fi fi
  148.  a c done endl
  149. fx_self_glitching_cascade_preview :
  150. index=0
  151. layers=l
  152. -fx_self_glitching_cascade $*
  153. #repeat {max(0,$layers)}
  154. #ac[$index] "-fx_self_glitching_cascade $*",$25
  155. #index={$index+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