Please bookmark this page to avoid losing your image tool!

Photo Gloomy 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');

    // Use naturalWidth/Height for intrinsic image dimensions, fallback to width/height
    // This ensures we use the original image size, not any styled/resized version.
    const imgWidth = originalImg.naturalWidth || originalImg.width;
    const imgHeight = originalImg.naturalHeight || originalImg.height;

    // Set canvas dimensions to match the image
    canvas.width = imgWidth;
    canvas.height = imgHeight;

    // Define the "gloomy" filter properties.
    // This combination aims for a desaturated, darker, slightly higher contrast image
    // with a cool (blueish/cyanish) tint, often associated with a "gloomy" atmosphere.

    // 1. Saturate: Reduces color vibrancy. 20% saturation makes it very muted.
    const saturation = '20%';
    // 2. Brightness: Darkens the image. 75% brightness is noticeably darker.
    const brightnessValue = '75%';
    // 3. Contrast: Increases the difference between light and dark areas. 120% is a moderate boost.
    const contrastValue = '120%';
    // 4. Cool Tint: This is achieved by applying a sepia tone and then rotating its hue by 180 degrees.
    //    Sepia filter typically adds a warm (yellowish-brown) tone.
    //    Rotating this warm tone by 180 degrees on the color wheel shifts it to cool (blueish-cyan) tones.
    const sepiaAmount = '30%'; // A moderate sepia effect to serve as the base for the tint.
    const hueRotation = '180deg'; // Inverts the sepia's warmth to coolness.

    // Construct the filter string.
    // The order of filters can affect the final result. This order is standard.
    ctx.filter = `saturate(${saturation}) ` +
                 `brightness(${brightnessValue}) ` +
                 `contrast(${contrastValue}) ` +
                 `sepia(${sepiaAmount}) ` +
                 `hue-rotate(${hueRotation})`;

    // Draw the original image onto the canvas.
    // The filter defined above will be applied to the image as it's drawn.
    ctx.drawImage(originalImg, 0, 0, imgWidth, imgHeight);

    // It's good practice to reset the filter on the context if the context were to be reused
    // for other drawing operations immediately after this. However, since we are creating a new canvas
    // and context each time and returning the canvas, this is not strictly necessary for this function's isolated behavior.
    // Example: ctx.filter = 'none';

    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 Photo Gloomy Filter tool allows users to apply a gloomy effect to their images, transforming them with a muted color palette and a cool tint. This tool is ideal for creating atmospheric visuals suitable for art projects, photo editing, or social media posts that require a darker, more moody aesthetic. Users can easily upload their images, and with a few clicks, achieve a distinct look that enhances the emotional tone of their photos.

Leave a Reply

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