Please bookmark this page to avoid losing your image tool!

Photo Ambrotype 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, tint = "cool", tintIntensity = 0.5, contrast = -30, brightness = 10, milkyHighlights = 0.7, vignetteStrength = 0.6, vignetteSoftness = 0.8, noise = 10) {
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d', { willReadFrequently: true });

    // Ensure the image is loaded, though the problem implies originalImg is an Image object that has loaded.
    // Using naturalWidth/Height is best for unscaled dimensions.
    canvas.width = originalImg.naturalWidth || originalImg.width;
    canvas.height = originalImg.naturalHeight || originalImg.height;

    ctx.drawImage(originalImg, 0, 0, canvas.width, canvas.height);

    const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
    const data = imageData.data;
    const width = canvas.width;
    const height = canvas.height;
    const centerX = width / 2;
    const centerY = height / 2;
    const maxDist = Math.sqrt(centerX * centerX + centerY * centerY); // Distance to a corner

    function clamp(value, min = 0, max = 255) {
        return Math.min(Math.max(value, min), max);
    }

    for (let i = 0; i < data.length; i += 4) {
        let r_orig = data[i];
        let g_orig = data[i + 1];
        let b_orig = data[i + 2];

        // 1. Grayscale
        let gray = 0.299 * r_orig + 0.587 * g_orig + 0.114 * b_orig;
        
        let r = gray;
        let g = gray;
        let b = gray;

        // 2. Tinting
        if (tintIntensity > 0 && tint !== "none") {
            let r_tinted_target = gray;
            let g_tinted_target = gray;
            let b_tinted_target = gray;

            if (tint === "sepia") {
                r_tinted_target = gray * 1.15 + 30;
                g_tinted_target = gray * 1.10 + 10;
                b_tinted_target = gray * 0.90 - 10; 
            } else if (tint === "cool") {
                r_tinted_target = gray * 0.90 - 5;
                g_tinted_target = gray * 0.95;
                b_tinted_target = gray * 1.10 + 20; 
            } else if (tint === "warm") {
                r_tinted_target = gray * 1.10 + 20;
                g_tinted_target = gray * 1.05 + 5;
                b_tinted_target = gray * 0.90 - 5;
            }
        
            r = gray * (1 - tintIntensity) + r_tinted_target * tintIntensity;
            g = gray * (1 - tintIntensity) + g_tinted_target * tintIntensity;
            b = gray * (1 - tintIntensity) + b_tinted_target * tintIntensity;
        }

        // 3. Contrast and Brightness
        // Contrast formula: factor * (color - 128) + 128
        // The contrast value is from -100 to 100.
        const contrastFactor = (259 * (contrast + 255)) / (255 * (259 - contrast));
        r = contrastFactor * (r - 128) + 128 + brightness;
        g = contrastFactor * (g - 128) + 128 + brightness;
        b = contrastFactor * (b - 128) + 128 + brightness;

        // 4. Milky Highlights (compress extreme highlights)
        // milkyHighlights: 0 (no effect) to 1 (full compression to threshold)
        const highlightThreshold = 210; 
        if (milkyHighlights > 0) {
            if (r > highlightThreshold) {
                r = highlightThreshold + (r - highlightThreshold) * (1 - milkyHighlights);
            }
            if (g > highlightThreshold) {
                g = highlightThreshold + (g - highlightThreshold) * (1 - milkyHighlights);
            }
            if (b > highlightThreshold) {
                b = highlightThreshold + (b - highlightThreshold) * (1 - milkyHighlights);
            }
        }

        // 5. Vignette
        // vignetteStrength: 0 (no effect) to 1 (edges are black)
        // vignetteSoftness: 0.1 (sharp edge) to 2.0 (very soft gradient)
        if (vignetteStrength > 0) {
            const x_coord = (i / 4) % width;
            const y_coord = Math.floor((i / 4) / width);
            const dx = x_coord - centerX;
            const dy = y_coord - centerY;
            const dist = Math.sqrt(dx * dx + dy * dy);
            
            // Power for falloff: higher power = sharper edge
            // vignetteSoftness 0.1 -> power 20; vignetteSoftness 2.0 -> power 1
            const power = 2.0 / Math.max(0.1, vignetteSoftness); 
            const v_factor = Math.pow(dist / maxDist, power);
            const reduction = 1.0 - vignetteStrength * clamp(v_factor, 0, 1);

            r *= reduction;
            g *= reduction;
            b *= reduction;
        }

        // 6. Noise
        // noise: 0 (no noise) up to e.g. 50 (intensity of noise)
        if (noise > 0) {
            const noiseVal = (Math.random() - 0.5) * noise;
            r += noiseVal;
            g += noiseVal;
            b += noiseVal;
        }

        // Clamp final values
        data[i] = clamp(r);
        data[i + 1] = clamp(g);
        data[i + 2] = clamp(b);
        // Alpha (data[i+3]) remains unchanged
    }

    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 Photo Ambrotype Filter Effect Tool allows users to apply a vintage ambrotype photography style to their images. This tool provides various customizable effects, such as tinting (cool, sepia, or warm), contrast and brightness adjustments, milky highlight compression, vignette effects, and noise addition. Ideal for photographers, graphic designers, and enthusiasts looking to creatively enhance their images, this tool offers an easy way to achieve a classic, artistic aesthetic.

Leave a Reply

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

Other Image Tools:

Image Cross-Screen Star Filter Effect Tool

Image Tiffen Ultra Contrast Filter Effect Application

Photo Telephoto Lens Compression Filter Effect Tool

Image Leica M6 Camera Render Filter Effect

Image Cokin Sunset Filter Effect Application

Image CineScope Aspect Ratio Filter Effect Tool

Image Ilford FP4 Plus Filter Effect Tool

Image Infrared 850nm Filter Effect Tool

Image Pentax 67 Medium Format Filter Effect Tool

Image ARRI Alexa Cinema Camera Filter Effect Enhancer

Image Cinestill 50D Filter Effect Application

Image Kodachrome 64 Filter Effect Tool

Photo Lomography Berlin Kino Filter Effect Tool

Image Fujifilm Neopan Filter Effect Tool

Image Polaroid Instant Film Filter Effect Tool

Image Holga Camera Filter Effect Tool

Image Fisheye Lens Distortion Filter Effect Tool

Image Kodak Gold 200 Film Filter Effect Tool

Photo Macro Filter Effect Tool

Image Neutral Density Filter Effect Tool

Image Green Filter Black And White Effect Tool

Image Large Format Film Filter Effect Creator

Image Pinhole Camera Filter Effect Tool

Image Warming Filter Effect Tool

Image Fujifilm Pro 400H Filter Effect Application

Image Diffusion Filter Effect Tool

Image Push-Processed Film Filter Effect Tool

Image Color Temperature Orange Filter Effect Tool

Image Kodak Ektar 100 Film Filter Effect

Image Yellow Filter Black And White Effect Tool

Image Expired Film Filter Effect Tool

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

See All →