Please bookmark this page to avoid losing your image tool!

Image Ghosting Persistence Effect Adder

(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, ghostCount = 5, offsetX = -20, offsetY = 0, scaleStep = 1.0, opacityStart = 0.5, blurAmount = 0, blendMode = "screen") {
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');
    
    // Set canvas dimensions to match the original image
    const w = originalImg.width;
    const h = originalImg.height;
    canvas.width = w;
    canvas.height = h;

    // Draw the original base image
    ctx.globalAlpha = 1.0;
    ctx.globalCompositeOperation = 'source-over';
    ctx.drawImage(originalImg, 0, 0, w, h);

    // Parse parameters to guarantee correct types (handles both string/number inputs gracefully)
    const count = Math.max(0, parseInt(ghostCount, 10));
    const dx = parseFloat(offsetX);
    const dy = parseFloat(offsetY);
    const scale = parseFloat(scaleStep);
    const alphaStart = parseFloat(opacityStart);
    const blur = parseFloat(blurAmount);
    
    // Set proper blending mode to get the Ghosting/Persistence aesthetic 
    // Recommended modes: "screen", "lighten", "source-over", "overlay"
    ctx.globalCompositeOperation = String(blendMode);

    // Iteratively draw trailing "ghosts"
    for (let i = 1; i <= count; i++) {
        // Calculate a decaying opacity for each step in the persistence trail
        const currentAlpha = alphaStart * (1 - i / (count + 1));
        
        if (currentAlpha <= 0) break;
        ctx.globalAlpha = currentAlpha;

        if (blur > 0) {
            // Apply progressively increasing blur to simulate fading/motion trail
            ctx.filter = `blur(${blur * i}px)`;
        }

        // Calculate compounded scale and linear translation
        const currentScale = Math.pow(scale, i);
        const currentX = dx * i;
        const currentY = dy * i;

        ctx.save();
        
        // Translate to the middle for scaling from the center, plus the positional offset
        ctx.translate(w / 2 + currentX, h / 2 + currentY);
        ctx.scale(currentScale, currentScale);
        
        // Draw centered relative to the new origin
        ctx.drawImage(originalImg, -w / 2, -h / 2, w, h);
        
        ctx.restore();
    }

    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 Ghosting Persistence Effect Adder is a tool designed to create a motion trail or ‘ghosting’ aesthetic by layering multiple iterations of an image. By adjusting parameters such as the number of ghost layers, positional offsets, scaling, opacity decay, and blur intensity, users can simulate visual persistence effects often seen in long-exposure photography or motion trails. This tool is useful for digital artists looking to add a sense of movement, dreamlike atmospheres, or retro visual styles to their photos and graphic designs.

Leave a Reply

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