You can edit the below JavaScript code to customize the image tool.
Apply Changes
function processImage(originalImg, effectName = "klasky-csupo", mirrorMode = "none", intensity = 100) {
// Create the canvas and context
const canvas = document.createElement('canvas');
const w = originalImg.width;
const h = originalImg.height;
// Half width and height for mirroring effects
const w2 = Math.floor(w / 2);
const h2 = Math.floor(h / 2);
canvas.width = w;
canvas.height = h;
const ctx = canvas.getContext('2d');
// Initialize filter variables
let inv = 0, sep = 0, hue = 0, sat = 100, con = 100, bright = 100;
// Match the classic YouTube Poop / Editor visual effects
switch (effectName.toLowerCase().trim()) {
case "i-killed-x":
// Extreme red/cyan high-contrast horrific effect
inv = 100; sep = 100; hue = -50; sat = 750; con = 300; bright = 90;
break;
case "losky":
// Blown-out bright saturation with a hue shift
inv = 0; sep = 0; hue = 120; sat = 500; con = 250; bright = 110;
break;
case "g-major":
// Classic G-Major meme effect (deep reds and inverted hues)
inv = 100; sep = 100; hue = -90; sat = 600; con = 250; bright = 100;
break;
case "klasky-csupo":
default:
// Standard Klasky Csupo (cyan/magenta color inverse)
inv = 100; sep = 0; hue = 150; sat = 400; con = 250; bright = 100;
break;
}
// Apply the intensity scaling based on input
const satScaled = Math.max(0, sat * (intensity / 100));
const conScaled = Math.max(0, con * (intensity / 100));
// Construct and assign the CSS filter string
ctx.filter = `invert(${inv}%) sepia(${sep}%) hue-rotate(${hue}deg) saturate(${satScaled}%) contrast(${conScaled}%) brightness(${bright}%)`;
// Apply cursed symmetrical mirroring modes often seen in these video/image edits
const mode = mirrorMode.toLowerCase().trim();
if (mode === "horizontal-split") {
// Draw left side normal
ctx.drawImage(originalImg, 0, 0, w2, h, 0, 0, w2, h);
// Draw matched right side mirrored
ctx.save();
ctx.scale(-1, 1);
ctx.drawImage(originalImg, 0, 0, w2, h, -w, 0, w2, h);
ctx.restore();
} else if (mode === "vertical-split") {
// Draw top side normal
ctx.drawImage(originalImg, 0, 0, w, h2, 0, 0, w, h2);
// Draw bottom side mirrored
ctx.save();
ctx.scale(1, -1);
ctx.drawImage(originalImg, 0, 0, w, h2, 0, -h, w, h2);
ctx.restore();
} else if (mode === "quad") {
// Top-left
ctx.drawImage(originalImg, 0, 0, w2, h2, 0, 0, w2, h2);
// Top-right (mirrored horizontally)
ctx.save();
ctx.scale(-1, 1);
ctx.drawImage(originalImg, 0, 0, w2, h2, -w, 0, w2, h2);
ctx.restore();
// Bottom-left (mirrored vertically)
ctx.save();
ctx.scale(1, -1);
ctx.drawImage(originalImg, 0, 0, w2, h2, 0, -h, w2, h2);
ctx.restore();
// Bottom-right (mirrored both)
ctx.save();
ctx.scale(-1, -1);
ctx.drawImage(originalImg, 0, 0, w2, h2, -w, -h, w2, h2);
ctx.restore();
} else {
// Standard full drawing without mirror
ctx.drawImage(originalImg, 0, 0, w, h);
}
return canvas;
}
Apply Changes