Please bookmark this page to avoid losing your image tool!

Television Image Converter

(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, scanlineIntensity = 0.25, noiseIntensity = 0.15, rgbShift = 3, vignetteIntensity = 0.7) {
    // Parse parameters to ensure they are treated as numbers
    scanlineIntensity = Number(scanlineIntensity);
    noiseIntensity = Number(noiseIntensity);
    rgbShift = Math.round(Number(rgbShift));
    vignetteIntensity = Number(vignetteIntensity);

    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 currentData = imgData.data;
    
    // Create a copy of the original pixel data for sampling (essential for RGB shift)
    const srcData = new Uint8ClampedArray(currentData);

    const cx = width / 2;
    const cy = height / 2;
    const maxDist = Math.sqrt(cx * cx + cy * cy);

    // Dynamic scanline thickness based on image height to look consistent across resolutions
    const scanlineThickness = Math.max(1, Math.floor(height / 400));

    for (let y = 0; y < height; y++) {
        // Determine if we are on a dark scanline
        const isScanline = (Math.floor(y / scanlineThickness) % 2 === 0);
        const scanlineMult = isScanline ? (1 - scanlineIntensity) : 1;

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

            // Chromatic Aberration 
            // Shift the red channel to the left
            const rx = Math.max(0, x - rgbShift);
            const ri = (y * width + rx) * 4;
            let r = srcData[ri];

            // Green remains centered
            let g = srcData[i + 1];

            // Shift the blue channel to the right
            const bx = Math.min(width - 1, x + rgbShift);
            const bi = (y * width + bx) * 4;
            let b = srcData[bi + 2];

            // Static Noise Addition
            const noise = (Math.random() - 0.5) * 255 * noiseIntensity;
            r += noise;
            g += noise;
            b += noise;

            // Scanline Darkening
            r *= scanlineMult;
            g *= scanlineMult;
            b *= scanlineMult;

            // CRT Vignette (Corners are darker, center is brighter)
            const dx = x - cx;
            const dy = y - cy;
            const dist = Math.sqrt(dx * dx + dy * dy);
            const vFactor = Math.max(0, 1 - Math.pow(dist / maxDist, 2) * vignetteIntensity);

            // Apply vignette and assign back to the image data array
            currentData[i] = r * vFactor;
            currentData[i + 1] = g * vFactor;
            currentData[i + 2] = b * vFactor;
            currentData[i + 3] = srcData[i + 3]; // Keep original alpha transparent pixels intact
        }
    }

    // Write modified pixels back to 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!

Description

The Television Image Converter is a tool designed to apply retro analog television effects to your digital images. It simulates the visual characteristics of old CRT monitors by incorporating scanlines, static noise, chromatic aberration (RGB shifting), and vignette shading. This tool is ideal for photographers, graphic designers, or content creators looking to achieve a nostalgic, lo-fi, or vintage aesthetic for social media posts, digital art, or video assets.

Leave a Reply

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