Please bookmark this page to avoid losing your image tool!

Image Crazy TV Channel Mania Filter

(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, noiseLevel = 30) {
    // Parse parameters to ensure they are numbers
    intensity = Number(intensity);
    noiseLevel = Number(noiseLevel);
    
    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);

    const imgData = ctx.getImageData(0, 0, width, height);
    const data = imgData.data;
    const outData = new Uint8ClampedArray(data.length);

    // Normalize levels between 0 and 1
    const intFactor = Math.min(Math.max(intensity / 100, 0), 1);
    const noiseFactor = Math.min(Math.max(noiseLevel / 100, 0), 1);

    // Generate random horizontal glitch bands to simulate a scrambled TV signal
    const bands = [];
    const numBands = Math.floor(10 + Math.random() * 40 * intFactor);
    for (let i = 0; i < numBands; i++) {
        bands.push({
            y: Math.floor(Math.random() * height),
            h: Math.floor(Math.random() * (height * 0.05) * intFactor + 2),
            shift: Math.floor((Math.random() - 0.5) * (width * 0.15) * intFactor),
            swap: Math.random() > 0.75 // Random chance to completely scramble channels in this band
        });
    }

    // Determine scanline thickness
    const scanlineSpc = Math.max(2, Math.floor(height / 250));

    for (let y = 0; y < height; y++) {
        let rowShift = 0;
        let channelSwap = false;
        
        // Apply glitch bands behavior if row belongs to one
        for (let b = 0; b < bands.length; b++) {
            if (y >= bands[b].y && y < bands[b].y + bands[b].h) {
                rowShift = bands[b].shift;
                channelSwap = bands[b].swap;
                break; 
            }
        }

        // Add a continuous underlying wave wobble (simulating bad vertical hold)
        const wobble = Math.sin(y * 0.05 + Math.random()) * 5 * intFactor;
        const totalShift = Math.floor(rowShift + wobble);

        for (let x = 0; x < width; x++) {
            const i = (y * width + x) * 4;

            // RGB offset to simulate Chromatic Aberration / color signal ghosting
            const rShift = Math.floor(width * 0.015 * intFactor);
            const bShift = Math.floor(-width * 0.015 * intFactor);

            // Fetch shifted channel coordinates, bounded correctly
            const srcXR = Math.min(width - 1, Math.max(0, x + totalShift + rShift));
            const idxR = (y * width + srcXR) * 4;
            
            const srcXG = Math.min(width - 1, Math.max(0, x + totalShift));
            const idxG = (y * width + srcXG) * 4 + 1;
            
            const srcXB = Math.min(width - 1, Math.max(0, x + totalShift + bShift));
            const idxB = (y * width + srcXB) * 4 + 2;

            let r = data[idxR];
            let g = data[idxG];
            let b = data[idxB];
            let a = data[i + 3];

            // Color channel swapping mania
            if (channelSwap) {
                const temp = r;
                r = b;
                b = g;
                g = temp;
            }

            // TV static noise overlay
            if (Math.random() < noiseFactor) {
                const noise = (Math.random() - 0.5) * 150 * noiseFactor;
                r += noise;
                g += noise;
                b += noise;
            }

            // Darken some lines (Scanline CRT effect)
            if (y % scanlineSpc === 0) {
                r *= 0.7;
                g *= 0.7;
                b *= 0.8; // Give shadows a slight blue tint purely for retro CRT style
            } else if (y % scanlineSpc === 1) {
                r *= 1.05;
                g *= 1.05;
                b *= 1.05; // Lighten adjoining line
            }
            
            // Random tiny pixel color inversion (sparks/digital mania drops)
            if (Math.random() < 0.002 * intFactor) {
                 r = 255 - r;
                 g = 255 - g;
                 b = 255 - b;
            }

            outData[i] = r;
            outData[i + 1] = g;
            outData[i + 2] = b;
            
            // Maintain original alpha integrity unless it's fully transparent
            outData[i + 3] = a; 
        }
    }

    // Write the transformed pixels back to image dataset
    for (let i = 0; i < data.length; i++) {
        data[i] = outData[i];
    }
    ctx.putImageData(imgData, 0, 0);

    // Apply intermittent screen overlays for more "mania" glitching
    if (intFactor > 0.3) {
        ctx.fillStyle = `rgba(255, 255, 255, ${0.1 * intFactor})`;
        ctx.fillRect(0, Math.random() * height, width, height * 0.1);
        
        ctx.fillStyle = `rgba(0, 0, 0, ${0.2 * intFactor})`;
        ctx.fillRect(0, Math.random() * height, width, height * 0.15);
    }

    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 Image Crazy TV Channel Mania Filter applies a retro, glitchy aesthetic to your images, simulating the appearance of a distorted or scrambled analog television signal. The tool uses various visual effects such as horizontal glitch bands, chromatic aberration, color channel swapping, and scanline overlays to create a high-energy, ‘glitch art’ look. It also incorporates TV static noise and subtle screen wobbles to enhance the vintage CRT monitor feel. This tool is ideal for graphic designers, content creators, or anyone looking to add a nostalgic, lo-fi, or chaotic aesthetic to social media posts, digital art projects, and video-themed imagery.

Leave a Reply

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