Please bookmark this page to avoid losing your image tool!

Image Echo Effect Generator

(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, numEchoes = 5, offsetX = 30, offsetY = 15, initialOpacity = 0.5, decay = 0.7, scale = 0.9) {
    // Parse input parameters to ensure they are the correct type
    numEchoes = parseInt(numEchoes, 10);
    offsetX = parseFloat(offsetX);
    offsetY = parseFloat(offsetY);
    initialOpacity = parseFloat(initialOpacity);
    decay = parseFloat(decay);
    scale = parseFloat(scale);

    // Fallback if parsing results in NaN
    if (isNaN(numEchoes) || numEchoes < 0) numEchoes = 5;
    if (isNaN(offsetX)) offsetX = 30;
    if (isNaN(offsetY)) offsetY = 15;
    if (isNaN(initialOpacity)) initialOpacity = 0.5;
    if (isNaN(decay)) decay = 0.7;
    if (isNaN(scale)) scale = 0.9;

    const origW = originalImg.width;
    const origH = originalImg.height;

    // Track bounding box constraints
    let minLeft = Infinity;
    let maxRight = -Infinity;
    let minTop = Infinity;
    let maxBottom = -Infinity;

    // Calculate the bounding box for the final canvas based on center positions and scaling
    for (let i = 0; i <= numEchoes; i++) {
        const currentScale = Math.pow(scale, i);
        const w = origW * currentScale;
        const h = origH * currentScale;
        
        // Echo shifts by offset per step
        const cx = i * offsetX;
        const cy = i * offsetY;
        
        // Compute edges
        const left = cx - w / 2;
        const right = cx + w / 2;
        const top = cy - h / 2;
        const bottom = cy + h / 2;

        if (left < minLeft) minLeft = left;
        if (right > maxRight) maxRight = right;
        if (top < minTop) minTop = top;
        if (bottom > maxBottom) maxBottom = bottom;
    }

    // Create the canvas accommodating the original image and all its echoes
    const canvas = document.createElement('canvas');
    canvas.width = Math.ceil(maxRight - minLeft);
    canvas.height = Math.ceil(maxBottom - minTop);
    const ctx = canvas.getContext('2d');

    // Draw from faintest (furthest echo) to the original image (i=0) so the original is on top
    for (let i = numEchoes; i >= 0; i--) {
        const currentScale = Math.pow(scale, i);
        const w = origW * currentScale;
        const h = origH * currentScale;
        
        // Determine center position on the new canvas
        const cx = i * offsetX - minLeft;
        const cy = i * offsetY - minTop;
        
        // Calculate top-left corner for drawImage
        const x = cx - w / 2;
        const y = cy - h / 2;

        // Apply fading logic
        if (i === 0) {
            ctx.globalAlpha = 1.0; // The primary original image is fully opaque
        } else {
            ctx.globalAlpha = Math.max(0, initialOpacity * Math.pow(decay, i - 1));
        }

        ctx.drawImage(originalImg, x, y, w, h);
    }

    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 Echo Effect Generator creates a stylized visual repetition of an image by layering multiple translucent versions of the original photo. Users can customize the effect by adjusting the number of echoes, their positional offset, opacity, fading decay, and scaling factors. This tool is useful for creating motion blur aesthetics, psychedelic art, or artistic social media graphics and design assets.

Leave a Reply

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