Please bookmark this page to avoid losing your image tool!

Image Aura Intensity Enhancer

(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, auraColor = '255, 255, 255', intensity = 20, threshold = 120) {
    // Sanitize and parse input parameters for robustness
    const safeIntensity = Math.max(0, Number(intensity));
    const safeThreshold = Math.max(0, Math.min(255, Number(threshold)));
    const colorParts = auraColor.split(',').map(s => parseInt(s.trim(), 10));
    const cssColor = (colorParts.length === 3 && colorParts.every(c => !isNaN(c))) 
        ? `rgb(${colorParts[0]}, ${colorParts[1]}, ${colorParts[2]})`
        : 'rgb(255, 255, 255)'; // Default to white on invalid format

    // 1. Setup the main canvas for the final output image
    const canvas = document.createElement('canvas');
    canvas.width = originalImg.naturalWidth;
    canvas.height = originalImg.naturalHeight;
    const ctx = canvas.getContext('2d');

    // 2. Create a silhouette on a temporary, off-screen canvas.
    // This silhouette will be used to cast the "aura" glow effect.
    const silhouetteCanvas = document.createElement('canvas');
    silhouetteCanvas.width = canvas.width;
    silhouetteCanvas.height = canvas.height;
    // Add willReadFrequently hint for performance optimization with getImageData
    const silhouetteCtx = silhouetteCanvas.getContext('2d', { willReadFrequently: true });

    silhouetteCtx.drawImage(originalImg, 0, 0, canvas.width, canvas.height);
    const imageData = silhouetteCtx.getImageData(0, 0, silhouetteCanvas.width, silhouetteCanvas.height);
    const data = imageData.data;

    // Isolate the "bodies" by making everything else transparent.
    // The logic assumes that the subjects ("bodies") are darker than the background.
    for (let i = 0; i < data.length; i += 4) {
        const r = data[i];
        const g = data[i + 1];
        const b = data[i + 2];
        
        // Use the standard luminosity formula for a more accurate perception of brightness
        const brightness = 0.299 * r + 0.587 * g + 0.114 * b;

        if (brightness < safeThreshold) {
            // This pixel is part of the subject. Keep it for the silhouette shape
            // by ensuring its alpha is 255. The actual color doesn't matter for the
            // drop-shadow filter, only the alpha channel.
            data[i + 3] = 255;
        } else {
            // This pixel is part of the background. Make it fully transparent.
            data[i + 3] = 0;
        }
    }
    // Put the modified pixel data back onto the silhouette canvas.
    silhouetteCtx.putImageData(imageData, 0, 0);

    // 3. Draw the aura glow onto the main canvas using the generated silhouette.
    
    // Applying multiple stacked drop-shadows with different radii creates a richer, more intense glow.
    // A wider, more diffuse outer glow is combined with a tighter, brighter inner glow.
    ctx.filter = `drop-shadow(0 0 ${safeIntensity}px ${cssColor}) drop-shadow(0 0 ${Math.floor(safeIntensity / 3)}px ${cssColor})`;

    // Drawing the silhouette source multiple times enhances the opacity and intensity of the glow.
    ctx.drawImage(silhouetteCanvas, 0, 0);
    ctx.drawImage(silhouetteCanvas, 0, 0);
    
    // 4. Draw the original image on top of the generated aura.
    
    // CRITICAL: Reset the filter before drawing the next layer, otherwise the original image
    // will also get a shadow, which is not the desired effect.
    ctx.filter = 'none'; 
    ctx.drawImage(originalImg, 0, 0);

    // 5. Return the final canvas containing the complete image with the aura effect.
    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 Aura Intensity Enhancer is a tool designed to add a glowing aura effect around images. Users can customize the aura color, intensity, and adjust the brightness threshold to isolate subjects within the image. This tool is useful for enhancing photographs, creating visually appealing graphics, or adding artistic effects for social media posts, promotional materials, or personal projects. It transforms images by making the subjects stand out against their backgrounds, creating an aesthetically striking look.

Leave a Reply

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