Please bookmark this page to avoid losing your image tool!

Calm Photo Filter

(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) {
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');

    // Ensure using natural dimensions of the image
    canvas.width = originalImg.naturalWidth || originalImg.width;
    canvas.height = originalImg.naturalHeight || originalImg.height;

    // Draw the original image onto the canvas
    ctx.drawImage(originalImg, 0, 0, canvas.width, canvas.height);

    // Get the pixel data from the canvas
    const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
    const data = imageData.data; // This is a Uint8ClampedArray: [R, G, B, A, R, G, B, A, ...]

    // Define filter parameters for a "calm" effect
    const desaturationAmount = 0.30; // 30% desaturation
    const coolRedAdjust = -15;       // Reduce red component
    const coolGreenAdjust = 5;       // Slightly increase green component (for a hint of teal/cyan)
    const coolBlueAdjust = 20;       // Increase blue component
    const brightnessIncrease = 10;   // Add a bit of brightness

    for (let i = 0; i < data.length; i += 4) {
        let r = data[i];
        let g = data[i + 1];
        let b = data[i + 2];
        // Alpha channel (data[i+3]) is preserved

        // 1. Desaturation
        // Standard luminance calculation
        const L = 0.299 * r + 0.587 * g + 0.114 * b;
        let r_desat = r * (1 - desaturationAmount) + L * desaturationAmount;
        let g_desat = g * (1 - desaturationAmount) + L * desaturationAmount;
        let b_desat = b * (1 - desaturationAmount) + L * desaturationAmount;

        // 2. Apply cool color tint
        let r_tinted = r_desat + coolRedAdjust;
        let g_tinted = g_desat + coolGreenAdjust;
        let b_tinted = b_desat + coolBlueAdjust;

        // 3. Apply brightness adjustment
        let r_final = r_tinted + brightnessIncrease;
        let g_final = g_tinted + brightnessIncrease;
        let b_final = b_tinted + brightnessIncrease;

        // Clamp values to the 0-255 range and round to integers
        data[i] = Math.round(Math.max(0, Math.min(255, r_final)));
        data[i + 1] = Math.round(Math.max(0, Math.min(255, g_final)));
        data[i + 2] = Math.round(Math.max(0, Math.min(255, b_final)));
    }

    // Put the modified pixel data back onto the canvas
    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

Calm Photo Filter is an online tool designed to enhance your images with a calming effect. Utilizing a unique combination of desaturation, color adjustments, and brightness enhancement, this filter transforms your photos by softening harsh colors and introducing a tranquil palette. Ideal for photographers, social media enthusiasts, or anyone looking to convey a serene mood in their imagery, this tool can help you create visually soothing photographs suitable for personal projects, online sharing, or professional use.

Leave a Reply

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