daily pastebin goal
57%
SHARE
TWEET

Untitled

a guest Sep 3rd, 2018 11 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;HCY","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",
  22. #@gui : "Modulo","Reverse Modulo","Divide","Reverse Divide","Subtract","Reverse Subtract",
  23. #@gui : "Left Bitwise Shift","Reverse LBS","Right Bitwise Shift","Reverse RBS","Left Bitwise Rotation","Reverse LBR","Right Bitwise Rotation","Reverse RBR",
  24. #@gui : "Average","Round","Reverse Round","Sine","Reverse Sine","Cosine","Reverse Cosine","Tangent","Reverse Tangent &#40;CPU-intensive&#41;",
  25. #@gui : "Cosecant","Reverse Cosecant","Secant","Reverse Secant","Cotangent","Reverse Cotangent","Variance","Difference","Minimum","Maximum",
  26. #@gui : "Interference &#40;Add&#41;","Reverse Interference &#40;Add&#41;","Interference &#40;Multiply&#41;",
  27. #@gui : "Interference &#40;Divide&#41;","Reverse Interference &#40;Div&#41;",
  28. #@gui : "Interference &#40;Subtract&#41;","Reverse Interference &#40;Subt&#41;","Interference &#40;Rev Subt&#41;","Reverse Interference &#40;Rev Subt&#41;",
  29. #@gui : "Interference &#40;Difference&#41;","Reverse Interference &#40;Diff&#41;","Interference &#40;Variance&#41;",
  30. #@gui : "Screen","Colour Dodge","Reverse Colour Dodge","Colour Burn","Reverse Colour Burn","Soft Light &#40;illusions&#46;hu&#41;","Reverse Soft Light &#40;illusions&#46;hu&#41;",
  31. #@gui : "Geometric Mean","Bright Hard Mix","Dark Hard Mix")
  32. #@gui : 20. Multiplier 1 = float(1,-10,10)
  33. #@gui : 21. Addition 1 = int(0,-1024,1024)
  34. #@gui : 22. Post-Shift Modulo = int(256,1,1024)
  35. #@gui : 23. Multiplier 2 = float(1,-10,10)
  36. #@gui : 24. Addition 2 = int(0,-1024,1024)
  37. #@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]")
  38. # #@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)
  39. #@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>")
  40. fx_self_glitching_cascade :
  41. shift {$4-50}%,{$5-50}%,0,0,$6,0
  42. repeat $! l[$>] if {!$3} split_opacity fi l[0] to_rgb
  43. if {$2}
  44. if {$1==0} rgb2srgb
  45. elif {$1==1} rgb2cmy
  46. elif {$1==2} rgb2hsv8
  47. elif {$1==3} rgb2hsl8
  48. elif {$1==4} rgb2hsi8
  49. elif {$1==5} rgb2lch8
  50. elif {$1==6} rgb2lab8
  51. elif {$1==7} rgb2ycbcrglic2
  52. elif {$1==8} rgb2yiq8
  53. elif {$1==9} rgb2yuv8
  54. elif {$1==10} rgb2hcy
  55. elif {$1==11} rgb2xyz8
  56. fi else
  57. if {$1==1} rgb2cmyk
  58. elif {$1==2} rgb2hsv
  59. elif {$1==3} rgb2hsl
  60. elif {$1==4} rgb2hsi
  61. elif {$1==5} rgb2lch
  62. elif {$1==6} rgb2lab
  63. elif {$1==7} rgb2ycbcr
  64. elif {$1==8} rgb2yiq
  65. elif {$1==9} rgb2yuv
  66. elif {$1==10} rgb2bayer 0
  67. elif {$1==11} rgb2xyz
  68. fi fi
  69. if $11 stype=$7 else stype=1 fi
  70. repeat $7
  71. +shift[0] {((([w,h]-1)*([$12,$13]-[$9,$10]+[u(-1,1),u(-1,1)]*sqrt((($12-$9)^2)+(($13-$10)^2))*($14^3)))/$stype)/100},0,0,$15
  72. f.. ">begin(
  73. const sign = $18?-1:1;
  74. );
  75. operate(mode,s1,s2,mult,power) =
  76. (mode==0?(s1 + s2):
  77. mode==1?(s1 * s2):
  78. mode==2?(s1 & s2):
  79. mode==3?(s1 | s2):
  80. mode==4?xor(s1,s2):
  81. mode==5?(s1^(s2*0.01)):
  82. mode==6?(s2^(s1*0.01)):
  83. mode==7?(s1%s2):
  84. mode==8?(s2%s1):
  85. mode==9?(s1 / s2):
  86. mode==10?(s2 / s1):
  87. mode==11?(s2 - s1):
  88. mode==12?(s1 - s2):
  89. mode==13?(s1 << s2):
  90. mode==14?(s2 << s1):
  91. mode==15?(s1 >> s2):
  92. mode==16?(s2 >> s1):
  93. mode==17?for(n=0,n<(s2%32),n++,rol(s1)):
  94. mode==18?for(n=0,n<(s1%32),n++,rol(s2)):
  95. mode==19?for(n=0,n<(s2%32),n++,ror(s1)):
  96. mode==20?for(n=0,n<(s1%32),n++,ror(s2)):
  97. mode==21?avg(s2,s1):
  98. mode==22?round(s1,s2,0):
  99. mode==23?round(s2,s1,0):
  100. mode==24?s2*sin(s1*2*pi/mult):
  101. mode==25?s1*sin(s2*2*pi/mult):
  102. mode==26?sign*s2*cos(s1*2*pi/mult):
  103. mode==27?sign*s1*cos(s2*2*pi/mult):
  104. mode==28?s2*tan(s1*pi/mult):
  105. mode==29?s1*tan(s2*pi/mult):
  106. mode==30?s2*sin(mult/(s1*2*pi)):
  107. mode==31?s1*sin(mult/(s2*2*pi)):
  108. mode==32?sign*s2*cos(mult/(s1*2*pi)):
  109. mode==33?sign*s1*cos(mult/(s2*2*pi)):
  110. mode==34?s2*tan(mult/(s1*pi)):
  111. mode==35?s1*tan(mult/(s2*pi)):
  112. mode==36?mult*var(s1,s2):
  113. mode==37?abs(s2 - s1):
  114. mode==38?min(s2,s1):
  115. mode==39?max(s2,s1):
  116. mode==40?0.005*s2*(((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power))+s1):
  117. mode==41?0.005*s1*((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)+s2):
  118. mode==42?0.1*s2*(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)*s1:
  119. mode==43?0.1*s2*(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)/s1:
  120. mode==44?0.1*s1*(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)/s2:
  121. mode==45?0.001*s2*((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)-s1):
  122. mode==46?0.001*s1*((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)-s2):
  123. mode==47?0.001*s2*(s1-(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)):
  124. mode==48?0.001*s1*(s2-(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)):
  125. mode==49?0.001*s2*abs((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)-s1):
  126. mode==50?0.001*s1*abs((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)-s2):
  127. mode==51?0.00001*mult*var(s1,s2,(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)):
  128. mode==52?(255-((255-s1)*(255-s2))):
  129. mode==53?(s1/(255-s2)):
  130. mode==54?(s2/(255-s1)):
  131. mode==55?((255-s2)/s1*255):
  132. mode==56?((255-s1)/s2*255):
  133. mode==57?((((s1)/255)^2)^(2*(0.5-(s2/255))))*255:
  134. mode==58?((((s2)/255)^2)^(2*(0.5-(s1/255))))*255:
  135. mode==59?sqrt(abs(s1*s2)):
  136. mode==60?(if((s1+s2)>=255,255,0)):
  137. (if((s1+s2)<=255,0,255)));
  138. val = sign*((2^$16)*j(#-1) + $17);operate($19,val,i,$20,$16);
  139. " rm.
  140. if {$8}
  141. f "((((i*$20)+$21)%$22)*$23)+$24;"
  142. fi
  143. done
  144. if {!$8}
  145. f "((((i*$20)+$21)%$22)*$23)+$24;"
  146. fi
  147. if {$2}
  148. if {$1==0} srgb2rgb
  149. elif {$1==1} cmy2rgb
  150. elif {$1==2} hsv82rgb
  151. elif {$1==3} hsl82rgb
  152. elif {$1==4} hsi82rgb
  153. elif {$1==5} lch82rgb
  154. elif {$1==6} lab82rgb
  155. elif {$1==7} ycbcrglic2rgb
  156. elif {$1==8} yiq82rgb
  157. elif {$1==9} yuv82rgb
  158. elif {$1==10} hcy2rgb
  159. elif {$1==11} xyz82rgb
  160. fi else
  161. if {$1==1} cmyk2rgb
  162. elif {$1==2} hsv2rgb
  163. elif {$1==3} hsl2rgb
  164. elif {$1==4} hsi2rgb
  165. elif {$1==5} lch2rgb
  166. elif {$1==6} lab2rgb
  167. elif {$1==7} ycbcr2rgb
  168. elif {$1==8} yiq2rgb
  169. elif {$1==9} yuv2rgb
  170. elif {$1==10} bayer2rgb 0,0,0
  171. elif {$1==11} xyz2rgb
  172. fi fi
  173.   endl a c endl done
  174. fx_self_glitching_cascade_preview :
  175. #fx_self_glitching_cascade $*
  176. repeat {max(0,l)}
  177. ac[$>] "-fx_self_glitching_cascade $*",$25
  178. 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