Please bookmark this page to avoid losing your image tool!

Image Retro Effect Applicator

(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.
/**
 * Applies a retro effect (sepia, noise, vignette) to an image.
 *
 * @param {HTMLImageElement} originalImg The original image object.
 * @param {number} [sepiaAmount=0.7] The intensity of the sepia effect (0 to 1). Default is 0.7.
 * @param {number} [noiseAmount=0.1] The intensity of the noise effect (0 to 1). Default is 0.1.
 * @param {number} [vignetteAmount=0.5] The intensity of the vignette effect (0 to 1). Default is 0.5.
 * @returns {HTMLCanvasElement} A canvas element displaying the image with the retro effect.
 */
function processImage(originalImg, sepiaAmount = 0.7, noiseAmount = 0.1, vignetteAmount = 0.5) {
    // Ensure parameters are treated as numbers and are within valid range
    const sepia = Math.max(0, Math.min(1, Number(sepiaAmount) || 0));
    const noise = Math.max(0, Math.min(1, Number(noiseAmount) || 0));
    const vignette = Math.max(0, Math.min(1, Number(vignetteAmount) || 0));

    // Create a canvas element
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');

    // Set canvas dimensions to match the image
    // Use naturalWidth/Height to get the original dimensions
    const width = originalImg.naturalWidth;
    const height = originalImg.naturalHeight;
    canvas.width = width;
    canvas.height = height;

    // Draw the original image onto the canvas
    ctx.drawImage(originalImg, 0, 0, width, height);

    // Get the image data object
    const imageData = ctx.getImageData(0, 0, width, height);
    // The data property is a flat Uint8ClampedArray: [R1, G1, B1, A1, R2, G2, B2, A2, ...]
    const data = imageData.data;

    const centerX = width / 2;
    const centerY = height / 2;
    // Maximum distance from center (to a corner) for vignette calculation
    const maxDist = Math.sqrt(centerX * centerX + centerY * centerY);

    // Iterate over each pixel (4 bytes at a time: R, G, B, A)
    for (let i = 0; i < data.length; i += 4) {
        let r = data[i];
        let g = data[i + 1];
        let b = data[i + 2];
        const originalR = r;
        const originalG = g;
        const originalB = b;

        // 1. Apply Sepia Filter
        if (sepia > 0) {
            // Standard sepia calculation
            const sepiaR = Math.min(255, 0.393 * originalR + 0.769 * originalG + 0.189 * originalB);
            const sepiaG = Math.min(255, 0.349 * originalR + 0.686 * originalG + 0.168 * originalB);
            const sepiaB = Math.min(255, 0.272 * originalR + 0.534 * originalG + 0.131 * originalB);

            // Interpolate between original and sepia based on sepiaAmount
            r = (1 - sepia) * originalR + sepia * sepiaR;
            g = (1 - sepia) * originalG + sepia * sepiaG;
            b = (1 - sepia) * originalB + sepia * sepiaB;
        }

        // 2. Add Noise
        if (noise > 0) {
            // Generate noise value between -127*noise and +127*noise
            const noiseVal = (Math.random() - 0.5) * 2 * noise * 127;
            r += noiseVal;
            g += noiseVal;
            b += noiseVal;
        }

        // 3. Apply Vignette Effect
        if (vignette > 0) {
            // Calculate pixel coordinates
            const pixelIndex = i / 4;
            const x = pixelIndex % width;
            const y = Math.floor(pixelIndex / width);

            // Calculate distance from center
            const dist = Math.sqrt(Math.pow(x - centerX, 2) + Math.pow(y - centerY, 2));

            // Normalize distance (0 at center, 1 at corners)
            const normDist = dist / maxDist;

            // Calculate darkening factor based on distance and vignette amount.
            // Using power of 1.8 for a smoother falloff than quadratic (power of 2).
            const darkness = Math.max(0, 1.0 - vignette * Math.pow(normDist, 1.8));

            // Apply darkening
            r *= darkness;
            g *= darkness;
            b *= darkness;
        }

        // Clamp values R, G, B to the valid 0-255 range
        data[i] = Math.max(0, Math.min(255, r));
        data[i + 1] = Math.max(0, Math.min(255, g));
        data[i + 2] = Math.max(0, Math.min(255, b));
        // Alpha channel (data[i + 3]) remains unchanged
    }

    // Put the modified image data back onto the canvas
    ctx.putImageData(imageData, 0, 0);

    // Return the canvas element. It can be displayed directly in a div.
    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 Retro Effect Applicator tool allows users to apply a retro aesthetic to images through the addition of sepia tones, noise, and vignette effects. This tool is ideal for enhancing photographs with a vintage look, making it suitable for designers, photographers, and social media enthusiasts looking to create nostalgic or artistic images. Users can adjust the intensity of each effect, providing flexibility in achieving the desired retro style.

Leave a Reply

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

Other Image Tools:

Image Film Effect Creator

Image Wanted Poster Generator

Image To ASCII Art Converter

Image To The Pink Panther Show Episode Details Finder

Image To Pink Panther Show Episode Details Finder

Image To Big Hero 6 The Series 2017-2021 Show Details Finder

Image To Illumination Entertainment Movie Details Finder

Image To Walt Disney Animation Studios Movie Details Finder

Image To THX Logo History 1983-2023 Search Tool

Image To Thx 1983-2023 Search Tool

20th Century Fox 1935-2020 Variants Image Viewer

Image To Detailed Audio Description Generator

Detailed Dreamworks Image Variant Generator

Image To The Pink Panther Show Episode 1-124 Search Tool

Image To Tubi September 2026 Coming Soon Movie Search Tool

Image To Tubi Sep 2026 Movie Search Tool

Image To Dottie Chicken Movie Search Tool

Image To Gahlina Pintadinha Movie Search Tool

Image and Video Big Hero 6 The Series Search Tool

Image To Illumination Entertainment Movie Search Tool

Image Soft Bubble Overlay Adder

Image Aspect Ratio 20:9 Stretch Tool

Image To Music Search Finder

Image To Movie Details Finder

Image To Walt Disney Animation Studios Movie Search Tool

Beauty and the Beast Special Extended Edition 1991 Movie Info Tool

Image Information Extractor for Movie Details

Stretch Image To 9:16 Aspect Ratio

Image Aspect Ratio 2.55:1 Resizer

Image To 20:9 Aspect Ratio Converter

Big Hero 6 2014 Wonder Project Amazon Channel Video Image Tool

Android Ringtone MP3 Photo Player

Image To Low Voice Converter

Image Metadata Extractor for Big Hero 6 Video File

No description provided for an image utility tool

See All →