Please bookmark this page to avoid losing your image tool!

No Tool Description Provided For Image Or Photo Related Utility

(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.
/**
 * Applies a "Global Warming" (Глобальное потепление) effect to an image.
 * This includes a heatwave distortion, intense temperature (red/orange tint),
 * high contrast, and a harsh sun glare.
 *
 * @param {HTMLImageElement} originalImg - The source image object.
 * @param {number|string} temperature - The amount of heat/warmth to add (color shift). Default is 40.
 * @param {number|string} heatwaveIntensity - The amplitude of the heatwave wobbling distortion. Default is 4.
 * @param {number|string} applySunGlare - Whether to apply harsh sun glare (1 for true, 0 for false). Default is 1.
 * @returns {HTMLCanvasElement} - A canvas element containing the processed image.
 */
function processImage(originalImg, temperature = 40, heatwaveIntensity = 4, applySunGlare = 1) {
    const temp = parseFloat(temperature);
    const hwIntensity = parseFloat(heatwaveIntensity);
    const glare = parseInt(applySunGlare, 10);

    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');
    
    const width = originalImg.width;
    const height = originalImg.height;
    
    canvas.width = width;
    canvas.height = height;

    // Draw the source image onto the canvas
    ctx.drawImage(originalImg, 0, 0);
    
    let imgData;
    try {
        imgData = ctx.getImageData(0, 0, width, height);
    } catch (e) {
        console.error("Failed to get image data. Ensure the image is not cross-origin restricted.", e);
        return canvas;
    }

    const data = imgData.data;
    
    // Create new image data for the output
    const outData = ctx.createImageData(width, height);
    const odata = outData.data;

    // Sun glare properties
    const centerX = width / 2;
    const centerY = height * 0.05; // Placed near the top
    const maxDist = Math.max(width, height) * 0.7;

    for (let y = 0; y < height; y++) {
        // Calculate heat wave X displacement once per row
        let displacement = 0;
        if (hwIntensity > 0) {
            // Wave frequency relies on image height
            displacement = Math.floor(Math.sin((y / height) * 60) * hwIntensity);
        }

        for (let x = 0; x < width; x++) {
            // Source pixel mapping for heatwave distortion
            let srcX = x + displacement;
            
            // Constrain within boundaries
            srcX = Math.max(0, Math.min(width - 1, srcX));

            const srcIdx = (y * width + srcX) * 4;
            const dstIdx = (y * width + x) * 4;

            let r = data[srcIdx];
            let g = data[srcIdx + 1];
            let b = data[srcIdx + 2];
            let a = data[srcIdx + 3];

            // 1. Shift Temperature (Boost red, moderate green, drop blue)
            r += temp;
            g += temp * 0.4;
            b -= temp * 0.8;

            // 2. Adjust Contrast (Harsher environment)
            const contrast = 1.25;
            r = ((r / 255 - 0.5) * contrast + 0.5) * 255;
            g = ((g / 255 - 0.5) * contrast + 0.5) * 255;
            b = ((b / 255 - 0.5) * contrast + 0.5) * 255;

            // 3. Apply Sun Glare (Harsh brightness originating from top center)
            if (glare === 1) {
                const dx = x - centerX;
                const dy = y - centerY;
                const dist = Math.sqrt(dx * dx + dy * dy);
                const glareFactor = Math.max(0, 1 - (dist / maxDist));

                const glareAdd = glareFactor * 80;
                r += glareAdd;
                g += glareAdd * 0.9;
                b += glareAdd * 0.5;
            }

            // Clamping is handled automatically by Uint8ClampedArray
            odata[dstIdx] = r;
            odata[dstIdx + 1] = g;
            odata[dstIdx + 2] = b;
            odata[dstIdx + 3] = a;
        }
    }

    ctx.putImageData(outData, 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

This tool applies a ‘Global Warming’ visual effect to images to simulate an intense, high-temperature environment. The effect incorporates a heatwave distortion to create a wobbling visual effect, a warm color temperature shift using red and orange tints, increased contrast, and a harsh sun glare. This tool can be used for creative photography, digital art projects, or to visually represent environmental themes such as extreme heat and climate change.

Leave a Reply

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