Please bookmark this page to avoid losing your image tool!

Image Expired Film Filter Effect Tool

(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, saturationReduction = 0.5, contrastFactor = 1.2, tintColorStr = "220,190,150", tintStrength = 0.2, grainAmount = 20) {
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');

    // Ensure using natural dimensions of the image
    // For an Image object, naturalWidth/Height are the intrinsic dimensions.
    // Fallback to width/height if naturalWidth/Height somehow aren't available.
    canvas.width = originalImg.naturalWidth || originalImg.width;
    canvas.height = originalImg.naturalHeight || originalImg.height;

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

    // Get image data to manipulate pixels
    const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
    const data = imageData.data;

    // Parse tint color string "R,G,B" into an array of numbers
    // Default to [0,0,0] (black) for components if parsing fails or not enough values
    const parsedTint = tintColorStr.split(',').map(s => parseInt(s.trim(), 10));
    const tintR_param = isNaN(parsedTint[0]) ? 0 : parsedTint[0];
    const tintG_param = isNaN(parsedTint[1]) ? 0 : parsedTint[1];
    const tintB_param = isNaN(parsedTint[2]) ? 0 : parsedTint[2];

    // Helper function to clamp values between min and max
    function clamp(value, min = 0, max = 255) {
        return Math.max(min, Math.min(value, max));
    }

    for (let i = 0; i < data.length; i += 4) {
        let r = data[i];
        let g = data[i + 1];
        let b = data[i + 2];

        // 1. Desaturation
        // Values between 0 (no change) and 1 (full desaturation to grayscale)
        if (saturationReduction > 0 && saturationReduction <= 1) {
            // Luminosity method for grayscale conversion (standard weights)
            const grayscale = 0.299 * r + 0.587 * g + 0.114 * b;
            r = grayscale * saturationReduction + r * (1 - saturationReduction);
            g = grayscale * saturationReduction + g * (1 - saturationReduction);
            b = grayscale * saturationReduction + b * (1 - saturationReduction);
        }
        // r, g, b are now desaturated, still approximately in [0,255]

        // 2. Contrast Adjustment
        // factor > 0. 1.0 means no change. >1 increases contrast, <1 decreases.
        if (contrastFactor > 0 && contrastFactor !== 1.0) {
            r = ((r / 255 - 0.5) * contrastFactor + 0.5) * 255;
            g = ((g / 255 - 0.5) * contrastFactor + 0.5) * 255;
            b = ((b / 255 - 0.5) * contrastFactor + 0.5) * 255;
        }
        // Clamp after contrast as values can go out of [0,255]
        r = clamp(r);
        g = clamp(g);
        b = clamp(b);

        // 3. Color Tint
        // strength between 0 (no tint) and 1 (full tint color).
        if (tintStrength > 0 && tintStrength <= 1) {
            r = r * (1 - tintStrength) + tintR_param * tintStrength;
            g = g * (1 - tintStrength) + tintG_param * tintStrength;
            b = b * (1 - tintStrength) + tintB_param * tintStrength;
        }
        // Clamp after tint
        r = clamp(r);
        g = clamp(g);
        b = clamp(b);

        // 4. Grain
        // amount is the max deviation for pixel component values.
        if (grainAmount > 0) {
            // Generate a single noise value for a monochromatic grain effect
            const grainOffset = (Math.random() * 2 - 1) * grainAmount; // Range: [-grainAmount, +grainAmount]
            r += grainOffset;
            g += grainOffset;
            b += grainOffset;
        }

        // Final Clamp for all operations (mainly for grain, but also catches any intermediate oversight)
        data[i] = clamp(r);
        data[i + 1] = clamp(g);
        data[i + 2] = clamp(b);
        // Alpha channel (data[i+3]) remains unchanged
    }

    // Put the modified image data back onto the canvas
    ctx.putImageData(imageData, 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 Image Expired Film Filter Effect Tool allows users to transform their images by applying a vintage, expired film look. This tool can adjust the saturation, contrast, and tint of the image, as well as add a grainy texture to replicate the aesthetic of old photographs. It is ideal for photographers, graphic designers, or anyone looking to create a retro feel in their images, enhancing them for personal projects, social media posts, or creative presentations.

Leave a Reply

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

Other Image Tools:

Image Circular Polarizer Filter Effect Tool

Image Lomography Purple Filter Effect Tool

Image Split Field Filter Effect Tool

Image Soft Focus Filter Effect Tool

Image Medium Format Film Filter Effect

Image Wide-Angle Lens Perspective Filter Effect Tool

Olympus OM-1 Photo Filter Effect Tool

Image Fujifilm Velvia Filter Effect Tool

Image Lensbaby Selective Focus Filter Effect Tool

Image Color Temperature Blue Filter Effect Tool

Image UV Filter Effect Tool

Image Red Filter Black And White Effect Tool

Image Redscale Film Filter Effect

Image Cinestill 800T Filter Effect Tool

Image Glimmer Glass Filter Effect Tool

Image Star Filter Effect Tool

Image Kodak Portra 400 Film Filter Effect

Image Fujifilm Superia Filter Effect Tool

Image Tilt-Shift Lens Filter Effect Tool

Image Graduated Neutral Density Filter Effect Tool

Image Diana Camera Filter Effect Tool

Image 35mm Film Camera Filter Effect Tool

Image Pro-Mist Filter Effect Application

Image Cross-Processed Slide Film Filter Effect Application

Image Pull-Processed Film Filter Effect Tool

Image Infrared Filter Effect Application

Image Ilford Delta 3200 Filter Effect Application

Image Cooling Filter Effect Tool

Image Fujifilm Instax Filter Effect Creator

Image Black And White Effect With Orange Filter

Image Kodak Tri-X Filter Effect Tool

Image Ilford HP5 Plus Filter Effect Application

Image Orchestra Seating Filter Effect

Image Braille Text Filter Effect

Image Missile Trajectory Filter Effect Tool

Image Ski Trail Filter Effect Tool

See All →