Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. #@gui JFIF Effects 2: fx_jfif_2, fx_jfif_2_preview(0)
  2. #@gui : note = note("<small>Poorly-implemented JPEG encoder. Low block dimensions will destroy the CPU!</small>")
  3. #@gui : 1. Quality Threshold (%) = float(50,0,100)
  4. #@gui : 2. Quality Mode = choice(2,"Rectangle 1","Rectangle 2","Diagonal 1","Diagonal 2")
  5. #@gui : 3. Detail Regain = float(2.5,0,10)
  6. #@gui : 4. Reverse Transform = bool(0)
  7. #@gui : 5. Block Width = int(8,1,32)
  8. #@gui : 6. Block Height = int(8,1,32)
  9. #@gui : 7. Colour Space = choice(14,"RGB","sRGB","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","Lab8","Lab","YCbCr","YCbCrGLIC","YCbCrJPEG","YIQ8","YIQ","YUV8","YUV","HCY","XYZ8","XYZ","CMY")
  10. #@gui : 8. Mirror = choice("None","X","Y","XY")
  11. #@gui : 9. Rotate = choice("None,"90 clockwise","180","90 anticlockwise")
  12. #@gui : 10. Mirror Blocks = choice("Off","X","Y","XY")
  13. #@gui : sep = separator()
  14. #@gui : note = note("Subsampling")
  15. #@gui : 11. Channel 0 = choice(0,"None","X","Y","XY")
  16. #@gui : 12. Channel 1 = choice(3,"None","X","Y","XY")
  17. #@gui : 13. Channel 2 = choice(3,"None","X","Y","XY")
  18. #@gui : sep = separator()
  19. #@gui : note = note("Glitch")
  20. #@gui : 14. Power = float(0,0,10)
  21. #@gui : 15. Colour Distortion = float(1,0,2)
  22. #@gui : 16. Max Glitch Length = int(5,2,10)
  23. #@gui : 17. Max Value Errors Per Tile = int(5,0,10)
  24. #@gui : 18. Error Strength = float(3,0,8)
  25. #@gui : 19. Persistent Value Errors Power = float(0.25,0,1)
  26. #@gui : 20. Error Bias = float(0.5,0,1)
  27. #@gui : 21. Tile Shift Power = float(0.25,0,1)
  28. fx_jfif_2:
  29. cd={$15^2.5}
  30. gl=$16
  31. ve=$17
  32. es=$18
  33. ste=$19
  34. bias={2^(6-($20*12))}
  35. ts={$21^2}
  36. q=$1/100
  37. con=$3
  38. bw=$5
  39. bh=$6
  40. cs=$7
  41. csswap 0,1,0,$cs
  42. sub0=$11
  43. sub1=$12
  44. sub2=$13
  45. if {$8==1}
  46. mirror x
  47. elif {$8==2}
  48. mirror y
  49. elif {$8==3}
  50. mirror xy
  51. fi
  52. if $9
  53. rotate {$9*90},0
  54. fi
  55. repeat $! l[$>]
  56. gp={(0.25^((10-$14)*log(wh(#0)*$bw*$bh)/(30*64)))*$14/10}
  57. iw={w}
  58. ih={h}
  59. s c
  60. i[G] {w(#0)},{h(#0)},1,1 f[$G] ">begin(chance = "$gp"; tlmax="$gl"; tt=-1; val=0; sticky="$ste";bw="$bw";bh="$bh";);
  61. if (!(x%(bh*2)) && !(y%(bh*2)),for (l = 0, l<2, ++l, for (k = 0, k<2, ++k, (u<=chance?((val=1);tt=round(u(1,tlmax))):tt>=0?(val=0;--tt):(u<=sticky?(val=-2):val=-1)); j(k*8,l*8)=val)),0)"
  62. repeat 3 l[$>,$G]
  63. cbw=$bw
  64. cbh=$bh
  65. if {${sub$>}==1}
  66. cbw*=2
  67. elif {${sub$>}==2}
  68. cbh*=2
  69. elif {${sub$>}==3}
  70. cbw*=2
  71. cbh*=2
  72. fi
  73. nw={w(#0)+(-w(#0)%$cbw)}
  74. nh={h(#0)+(-h(#0)%$cbh)}
  75. r {$nw},{$nh},1,100%,0,3
  76. l[^$G] split_tiles {-$cbw},{-$cbh} endl
  77. if $4 idct[^$G] else dct[^$G] fi
  78. f[^$G] "begin(q="$q";mode="$2";bw="$bw";bh="$bh";con=("$con"^2)/10);
  79. mode==0?val=round(i,100^(max(1+(max(x,y))-q*(max(bw,bh)),0))):
  80. mode==1?val=round(i,100^(max(1+(max(x/bw,y/bh)*max(bw,bh))-q*(max(bw,bh)),0))):
  81. mode==2?val=round(i,100^(max(1+(x+y)-q*(bw+bh),0))):
  82. mode==3?val=round(i,100^(max(1+((x/bw+y/bh)*max(bw,bh))-q*(2*max(bw,bh)),0)));
  83. val=val*(1+((max(x,y))^con)*con);
  84. round(val,10000*((1-q)^6))
  85. "
  86. f[^$G] "((x>"$bw")||y>"$bh")?0:i"
  87. if $4 dct[^$G] else idct[^$G] fi
  88. if {$10==1} mirror[^$G] x elif {$10==2} mirror[^$G] y elif {$10==3} mirror[^$G] xy fi
  89. append_tiles[^$G] {$nw/$cbw},{$nh/$cbh}
  90. endl done
  91. rm[$G]
  92. a c
  93. r {$iw},{$ih},1,100%,0,3
  94. endl
  95. done
  96. if $9
  97. rotate {$9*-90},0
  98. fi
  99. if {$8==1}
  100. mirror x
  101. elif {$8==2}
  102. mirror y
  103. elif {$8==3}
  104. mirror xy
  105. fi
  106. csswap $cs,1,0,0
  107. fx_jfif_2_preview:
  108. fx_jfif_2 $*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement