You can edit the below JavaScript code to customize the image tool.
function processImage(originalImg, mirrorType = "leftToRight", tintColor = "magenta", invertColors = "true", contrastLevel = "1.5") {
// Determine canvas dimensions from the original image
const w = originalImg.width;
const h = originalImg.height;
// Create an off-screen canvas
const canvas = document.createElement("canvas");
canvas.width = w;
canvas.height = h;
const ctx = canvas.getContext("2d", { willReadFrequently: true });
// 1. Structural effect: Mirroring (A classic feature of G-Major visual effects)
if (mirrorType === "leftToRight") {
// Draw the left half normally
ctx.drawImage(originalImg, 0, 0, w / 2, h, 0, 0, w / 2, h);
// Setup context to flip horizontally and draw the left half mirrored onto the right
ctx.save();
ctx.translate(w, 0);
ctx.scale(-1, 1);
ctx.drawImage(originalImg, 0, 0, w / 2, h, 0, 0, w / 2, h);
ctx.restore();
} else if (mirrorType === "rightToLeft") {
// Draw the right half normally
ctx.drawImage(originalImg, w / 2, 0, w / 2, h, w / 2, 0, w / 2, h);
// Setup context to flip horizontally and draw the right half mirrored onto the left
ctx.save();
ctx.translate(w, 0);
ctx.scale(-1, 1);
ctx.drawImage(originalImg, w / 2, 0, w / 2, h, w / 2, 0, w / 2, h);
ctx.restore();
} else {
// Draw original layout if no mirror is requested
ctx.drawImage(originalImg, 0, 0, w, h);
}
// 2. Color and Filter effects (Invert, Contrast, and Demonic Tinting)
const imgData = ctx.getImageData(0, 0, w, h);
const data = imgData.data;
const contrast = parseFloat(contrastLevel) || 1.5;
const doInvert = (invertColors === "true" || invertColors === "1");
for (let i = 0; i < data.length; i += 4) {
let r = data[i];
let g = data[i + 1];
let b = data[i + 2];
// Apply contrast
r = ((r - 128) * contrast) + 128;
g = ((g - 128) * contrast) + 128;
b = ((b - 128) * contrast) + 128;
// Clamp values to valid 0-255 ranges
r = Math.max(0, Math.min(255, r));
g = Math.max(0, Math.min(255, g));
b = Math.max(0, Math.min(255, b));
// Apply inversion (Staple of G-Major video effects)
if (doInvert) {
r = 255 - r;
g = 255 - g;
b = 255 - b;
}
// Apply tint overrides to simulate the deep-fried, corrupted look
if (tintColor === "magenta") {
r = Math.min(255, r * 1.6);
g = g * 0.5;
b = Math.min(255, b * 1.3);
} else if (tintColor === "red") {
r = Math.min(255, r * 1.8);
g = g * 0.4;
b = b * 0.4;
} else if (tintColor === "cyan") {
r = r * 0.4;
g = Math.min(255, g * 1.6);
b = Math.min(255, b * 1.6);
} else if (tintColor === "green") {
r = r * 0.4;
g = Math.min(255, g * 1.8);
b = b * 0.4;
} else if (tintColor === "blue") {
r = r * 0.4;
g = g * 0.4;
b = Math.min(255, b * 1.8);
}
// Reassign the distorted pixels
data[i] = r;
data[i + 1] = g;
data[i + 2] = b;
}
// Put image data back onto the canvas
ctx.putImageData(imgData, 0, 0);
return canvas;
}
Free Image Tool Creator
Can't find the image tool you're looking for? Create one based on your own needs now!
The G-Major 5 Image Effect Generator is a tool designed to apply stylized, distorted visual effects to your images. It can transform images by applying horizontal mirroring (left-to-right or right-to-left), inverting color values, and adjusting contrast levels. Additionally, it features color tinting options—such as magenta, red, cyan, green, and blue—to create a high-contrast, surreal, or ‘corrupted’ aesthetic. This tool is ideal for users looking to create meme content, experimental digital art, or stylized visual effects for social media and creative projects.