daily pastebin goal
66%
SHARE
TWEET

Untitled

a guest Aug 29th, 2018 10 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 has 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,64)
  11. #@gui : 8. Repeat post-shift operations = bool(1)
  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. Shift 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. repeat $7
  60. f "init(
  61. const stype = $11?$7:1;
  62. shift = ((([w,h]-1)*([$12,$13]-[$9,$10]+[u(-1,1),u(-1,1)]*sqrt((($12-$9)^2)+(($13-$10)^2))*($14^3)))/stype)%;
  63. const sign = $18?-1:1;
  64. const boundary = $15;
  65. );
  66. operate(mode,s1,s2,mult,power) =
  67. (mode==0?(s1 + s2):
  68. mode==1?(s1 * s2):
  69. mode==2?(s1 & s2):
  70. mode==3?(s1 | s2):
  71. mode==4?xor(s1,s2):
  72. mode==5?(s1^s2):
  73. mode==6?(s2^s1):
  74. mode==7?(s1%s2):
  75. mode==8?(s2%s1):
  76. mode==9?(s1 / s2):
  77. mode==10?(s2 / s1):
  78. mode==11?(s2 - s1):
  79. mode==12?(s1 - s2):
  80. mode==13?(s1 << s2):
  81. mode==14?(s2 << s1):
  82. mode==15?(s1 >> s2):
  83. mode==16?(s2 >> s1):
  84. mode==17?for(n=0,n<(s2%32),n++,rol(s1)):
  85. mode==18?for(n=0,n<(s1%32),n++,rol(s2)):
  86. mode==19?for(n=0,n<(s2%32),n++,ror(s1)):
  87. mode==20?for(n=0,n<(s1%32),n++,ror(s2)):
  88. mode==21?avg(s2,s1):
  89. mode==22?round(s1,s2,0):
  90. mode==23?round(s2,s1,0):
  91. mode==24?s2*sin(s1*2*pi/mult):
  92. mode==25?s1*sin(s2*2*pi/mult):
  93. mode==26?sign*s2*cos(s1*2*pi/mult):
  94. mode==27?sign*s1*cos(s2*2*pi/mult):
  95. mode==28?s2*tan(s1*pi/mult):
  96. mode==29?s1*tan(s2*pi/mult):
  97. mode==30?s2*sin(mult/(s1*2*pi)):
  98. mode==31?s1*sin(mult/(s2*2*pi)):
  99. mode==32?sign*s2*cos(mult/(s1*2*pi)):
  100. mode==33?sign*s1*cos(mult/(s2*2*pi)):
  101. mode==34?s2*tan(mult/(s1*pi)):
  102. mode==35?s1*tan(mult/(s2*pi)):
  103. mode==36?mult*var(s1,s2):
  104. mode==37?abs(s2 - s1):
  105. mode==38?min(s2,s1):
  106. mode==39?max(s2,s1):
  107. mode==40?0.005*s2*(((j(0,0,0,(c+1)%(s(#0)-1)+1)*2^pow))+s1):
  108. mode==41?0.005*s1*((j(0,0,0,(c+1)%(s(#0)-1)+1)*2^pow)+s2):
  109. mode==42?0.1*s2*(j(0,0,0,(c+1)%(s(#0)-1)+1)*2^pow)*s1:
  110. mode==43?0.1*s2*(j(0,0,0,(c+1)%(s(#0)-1)+1)*2^pow)/s1:
  111. mode==44?0.1*s1*(j(0,0,0,(c+1)%(s(#0)-1)+1)*2^pow)/s2:
  112. mode==45?0.001*s2*((j(0,0,0,(c+1)%(s(#0)-1)+1)*2^pow)-s1):
  113. mode==46?0.001*s1*((j(0,0,0,(c+1)%(s(#0)-1)+1)*2^pow)-s2):
  114. mode==47?0.001*s2*(s1-(j(0,0,0,(c+1)%(s(#0)-1)+1)*2^pow)):
  115. mode==48?0.001*s1*(s2-(j(0,0,0,(c+1)%(s(#0)-1)+1)*2^pow)):
  116. mode==49?0.001*s2*abs((j(0,0,0,(c+1)%(s(#0)-1)+1)*2^pow)-s1):
  117. mode==50?0.001*s1*abs((j(0,0,0,(c+1)%(s(#0)-1)+1)*2^pow)-s2):
  118. 0.00001*mult*var(s1,s2,(j(0,0,0,(c+1)%(s(#0)-1)+1)*2^pow)));
  119. val = sign*((2^$16)*j(shift) + $17);operate($19,val,i,$20,$16);
  120. "
  121. if {$8}
  122. f "((((i*$20)+$21)%$22)*$23)+$24;"
  123. fi
  124. done
  125. if {!$8}
  126. f "((((i*$20)+$21)%$22)*$23)+$24;"
  127. fi
  128. if {$2}
  129. if {$1==0} srgb2rgb
  130. elif {$1==1} cmy2rgb
  131. elif {$1==2} hsv82rgb
  132. elif {$1==3} hsl82rgb
  133. elif {$1==4} hsi82rgb
  134. elif {$1==5} lch82rgb
  135. elif {$1==6} lab82rgb
  136. elif {$1==7} ycbcr_22rgb
  137. elif {$1==8} yiq82rgb
  138. elif {$1==9} yuv82rgb
  139. elif {$1==10} int2rgb
  140. elif {$1==11} xyz82rgb
  141. fi else
  142. if {$1==1} cmyk2rgb
  143. elif {$1==2} hsv2rgb
  144. elif {$1==3} hsl2rgb
  145. elif {$1==4} hsi2rgb
  146. elif {$1==5} lch2rgb
  147. elif {$1==6} lab2rgb
  148. elif {$1==7} ycbcr2rgb
  149. elif {$1==8} yiq2rgb
  150. elif {$1==9} yuv2rgb
  151. elif {$1==10} bayer2rgb 0,0,0
  152. elif {$1==11} xyz2rgb
  153. fi fi
  154.   endl a c endl done
  155. fx_self_glitching_cascade_preview :
  156. index=0
  157. layers=l
  158. #-fx_self_glitching_cascade $*
  159. repeat {max(0,$layers)}
  160. ac[$index] "-fx_self_glitching_cascade $*",$25
  161. index={$index+1}
  162. done
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