Please bookmark this page to avoid losing your image tool!

Image Deardorff Large Format Filter Effect Application

(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, sepiaAmount = 0.6, saturationValue = 0.8, contrastValue = 1.1, blurRadius = 1, vignetteStrength = 0.7, vignetteStartRatio = 0.3, vignetteEndRatio = 0.9) {

    // Sanitize and convert parameters:
    // Ensure they are numbers and fall within reasonable/expected ranges.
    // parseFloat(String(param)) handles both string and number inputs.
    // The '|| 0' provides a default if parsing fails (e.g., non-numeric string).
    const numSepiaAmount = Math.max(0, Math.min(1, parseFloat(String(sepiaAmount)) || 0));
    const numSaturationValue = Math.max(0, parseFloat(String(saturationValue)) || 0); // No upper bound, but typically 0-2
    const numContrastValue = Math.max(0, parseFloat(String(contrastValue)) || 0);   // No upper bound, but typically 0-2
    const numBlurRadius = Math.max(0, parseFloat(String(blurRadius)) || 0);
    const numVignetteStrength = Math.max(0, Math.min(1, parseFloat(String(vignetteStrength)) || 0));
    const numVignetteStartRatio = Math.max(0, Math.min(1, parseFloat(String(vignetteStartRatio)) || 0));
    const numVignetteEndRatio = Math.max(0, Math.min(1, parseFloat(String(vignetteEndRatio)) || 0));

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

    const imgWidth = originalImg.naturalWidth || originalImg.width;
    const imgHeight = originalImg.naturalHeight || originalImg.height;

    // Handle cases where the image might not have loaded or has invalid dimensions
    if (imgWidth <= 0 || imgHeight <= 0) {
        // Return a minimal 1x1 canvas if image dimensions are invalid
        canvas.width = 1;
        canvas.height = 1;
        // console.warn("Original image has invalid dimensions or failed to load."); // Optional warning
        return canvas;
    }

    canvas.width = imgWidth;
    canvas.height = imgHeight;

    // 1. Apply base image filters (sepia, saturation, contrast, blur)
    // Construct the filter string by joining individual filter functions.
    const filters = [];
    if (numSepiaAmount > 0) { // sepia(0) is no effect
        filters.push(`sepia(${numSepiaAmount})`);
    }
    if (numSaturationValue !== 1) { // saturate(1) is no effect
        filters.push(`saturate(${numSaturationValue})`);
    }
    if (numContrastValue !== 1) { // contrast(1) is no effect
        filters.push(`contrast(${numContrastValue})`);
    }
    if (numBlurRadius > 0) { // blur(0px) is no effect
        filters.push(`blur(${numBlurRadius}px)`);
    }
    
    if (filters.length > 0) {
        ctx.filter = filters.join(' ');
    }

    // Draw the original image onto the canvas.
    // If filters were set, they are applied during this drawImage operation.
    ctx.drawImage(originalImg, 0, 0, imgWidth, imgHeight);

    // Reset the filter property to 'none' to ensure subsequent drawing operations
    // (like the vignette) are not affected by the previously set filters.
    ctx.filter = 'none';

    // 2. Apply Vignette
    // The vignette is applied only if its strength is positive and
    // the end ratio is greater than the start ratio, forming a valid gradient range.
    if (numVignetteStrength > 0 && numVignetteEndRatio > numVignetteStartRatio) {
        const centerX = imgWidth / 2;
        const centerY = imgHeight / 2;

        // Calculate the maximum radius for the gradient; typically the distance to a corner.
        // This ensures the vignette gradient can cover the entire image.
        const maxRadius = Math.sqrt(centerX * centerX + centerY * centerY);

        // r0 is the radius of the inner circle of the gradient (where the vignette effect starts).
        // It's scaled by numVignetteStartRatio relative to maxRadius.
        const r0 = maxRadius * numVignetteStartRatio;
        // r1 is the radius of the outer circle of the gradient (where vignette reaches full strength).
        // It's scaled by numVignetteEndRatio relative to maxRadius.
        const r1 = maxRadius * numVignetteEndRatio;
        
        // Create the radial gradient.
        const gradient = ctx.createRadialGradient(centerX, centerY, r0, centerX, centerY, r1);

        // Define color stops for the gradient:
        // Stop 0: At the inner radius (r0), the color is transparent black.
        gradient.addColorStop(0, 'rgba(0,0,0,0)');
        // Stop 1: At the outer radius (r1), the color is semi-transparent black,
        // with alpha controlled by numVignetteStrength.
        gradient.addColorStop(1, `rgba(0,0,0,${numVignetteStrength})`);

        // Apply the gradient as a fill style.
        ctx.fillStyle = gradient;
        
        // Fill the entire canvas with the gradient.
        // - Areas inside r0 (before the first stop) will take the color of the first stop (transparent).
        // - Areas between r0 and r1 will render the gradient transition.
        // - Areas outside r1 (after the last stop) will take the color of the last stop (`rgba(0,0,0,${numVignetteStrength})`).
        ctx.fillRect(0, 0, imgWidth, imgHeight);
    }

    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 Deardorff Large Format Filter Effect Application allows users to enhance their images with various artistic effects. Features include the ability to apply a sepia tone for a warm vintage look, adjust saturation and contrast for image clarity, and apply a blur effect for a soft focus. Additionally, the tool incorporates a vignette effect, which darkens the edges of the image to draw attention to the center. This tool is ideal for photographers, graphic designers, or anyone looking to creatively transform their images for social media, presentations, or personal projects.

Leave a Reply

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

Other Image Tools:

Image Lomo LC-A Filter Effect Tool

Image Large Format Filter Effect Application

Image Zone Plate Lens Effect Creator

Photo Kodak Retina Filter Effect Tool

Image Polaroid 600 Filter Effect Tool

Photo Black and White Yellow Filter Effect Tool

Image Contax G2 Film Camera Render Effect Applicator

Image 110 Film Format Filter Effect Tool

Photo Jupiter-9 Portrait Lens Filter Effect

Image Fujifilm GW690 Texas Leica Filter Effect Application

Image Zeiss T* Coating Filter Effect Tool

Image Hoya R72 Infrared Filter Effect Tool

Image Filter Effect for Zeiss Ikon Contaflex

Photo Olympus Mju-II/Stylus Epic Filter Effect Tool

Image NiSi Nano IR ND Filter Effect Tool

Image Polaroid SX-70 Filter Effect Tool

Image Linhof Technika Filter Effect Tool

Image Lee Big Stopper 10-Stop ND Filter Effect Tool

Image Minolta X-700 Film Camera Render Effect Creator

Image ORWO UN54 Motion Picture Film Effect Applicator

Image Shen-Hao Large Format Filter Effect Tool

Image Impossible Project Polaroid Filter Effect Tool

Photo Foma Retropan 320 Film Filter Effect Tool

Image Fuji QuickSnap Disposable Filter Effect Application

Image 220 Film Format Filter Effect

Image Black and White with Green #61 Filter Effect Tool

Image 35mm Panoramic Camera Filter Effect Tool

Image Hitech Firecrest ND Filter Effect Formatter

Photo Rodenstock Digital Vario ND Filter Effect Tool

Image Leica Yellow Filter Effect Application

Image Argus C3 Vintage Camera Filter Effect

Image ORWO NP22 Film Filter Effect Application

Image Wratten #25 Red Filter Effect Tool

Image Helios 44-2 Swirly Bokeh Effect Filter

Image Fujifilm ETERNA Motion Picture Film Effect Applicator

Image Fujifilm FP-100C Instant Film Effect Filter

See All →