Please bookmark this page to avoid losing your image tool!

Weird Image Effect Generator

(Free & Supports Bulk Upload)

Drag & drop your images here or

The result will appear here...
You can edit the below JavaScript code to customize the image tool.
function processImage(originalImg, intensity = 50, glitchAmount = 25) {
    // Parse parameters
    let parsedIntensity = Number(intensity);
    if (isNaN(parsedIntensity)) parsedIntensity = 50;
    
    let parsedGlitch = Number(glitchAmount);
    if (isNaN(parsedGlitch)) parsedGlitch = 25;

    // Create a canvas to work with
    const canvas = document.createElement("canvas");
    const width = originalImg.width;
    const height = originalImg.height;
    canvas.width = width;
    canvas.height = height;

    const ctx = canvas.getContext("2d");
    ctx.drawImage(originalImg, 0, 0);

    // Get original image data
    const imgData = ctx.getImageData(0, 0, width, height);
    const data = imgData.data;

    // Create a new ImageData object for the output
    const outputData = new ImageData(width, height);
    const out = outputData.data;

    // Define helper function to handle coordinate wrapping
    const wrap = (val, max) => {
        if (val < 0) return max - (-val % max);
        if (val >= max) return val % max;
        return val;
    };

    // Calculate Gears3000's Weird Effect
    for (let y = 0; y < height; y++) {
        for (let x = 0; x < width; x++) {
            
            // Generate weird distorted coordinates for different color channels
            // Using a combination of sine waves and tangent functions to create bizarre warping
            let sxR = Math.floor(x + Math.sin(y / 15) * parsedIntensity * Math.cos(y / 30));
            let syR = Math.floor(y + Math.cos(x / 15) * Math.tan(y / 150) * parsedIntensity);
            
            let sxG = Math.floor(x - Math.cos(y / 20) * parsedIntensity);
            let syG = Math.floor(y - Math.sin(x / 20) * parsedIntensity);
            
            let sxB = Math.floor(x + Math.sin((x + y) / 25) * parsedIntensity);
            let syB = Math.floor(y + Math.cos((x - y) / 25) * parsedIntensity);

            // Wrap coordinates to keep pixels sourced from the image safely
            sxR = wrap(sxR, width); syR = wrap(syR, height);
            sxG = wrap(sxG, width); syG = wrap(syG, height);
            sxB = wrap(sxB, width); syB = wrap(syB, height);

            // Calculate 1D indices for the pixel arrays
            const srcIdxR = (syR * width + sxR) * 4;
            const srcIdxG = (syG * width + sxG) * 4;
            const srcIdxB = (syB * width + sxB) * 4;
            
            const dstIdx = (y * width + x) * 4;

            // Fetch distorted color channels
            let r = data[srcIdxR];
            let g = data[srcIdxG + 1];
            let b = data[srcIdxB + 2];
            
            // Preserve alpha matching the destination coordinates
            const a = data[(y * width + x) * 4 + 3];

            // Apply a weird glitchy color bitwise mutation based on position
            if (parsedGlitch > 0) {
                const glitchPhase = Math.floor((x * y) / 100) % 3;
                if (glitchPhase === 0) {
                    r = r ^ Math.floor(parsedGlitch);
                } else if (glitchPhase === 1) {
                    g = g ^ Math.floor(parsedGlitch * Math.abs(Math.sin(y)));
                } else {
                    b = b ^ Math.floor(parsedGlitch * Math.abs(Math.cos(x)));
                }
            }

            // Assign manipulated pixel to output
            out[dstIdx] = r;
            out[dstIdx + 1] = g;
            out[dstIdx + 2] = b;
            out[dstIdx + 3] = a;
        }
    }

    // Write back to canvas
    ctx.putImageData(outputData, 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!

Description

The Weird Image Effect Generator is a creative tool designed to apply abstract distortions and glitch aesthetics to your images. By manipulating color channels through mathematical warping and bitwise mutations, it produces surreal, psychedelic, and glitchy visual results. This tool is ideal for digital artists, graphic designers, or social media enthusiasts looking to transform standard photos into unique pieces of experimental art, textures, or stylized backgrounds.

Leave a Reply

Your email address will not be published. Required fields are marked *