Please bookmark this page to avoid losing your image tool!

Image Fomapan 100 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, contrast = '1.2', grainAmount = '10') {
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');

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

    if (imgWidth === 0 || imgHeight === 0) {
        console.warn("Image has zero dimensions. Returning a 1x1 canvas.");
        // Create a minimal canvas to avoid errors downstream if size is 0
        canvas.width = 1;
        canvas.height = 1;
        // Optionally, fill it with a color or leave it transparent
        // ctx.fillStyle = 'rgba(0,0,0,0)'; // Transparent
        // ctx.fillRect(0,0,1,1);
        return canvas;
    }

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

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

    // Parse parameters, providing defaults if parsing fails or invalid
    let numContrast = parseFloat(contrast);
    if (isNaN(numContrast)) {
        numContrast = 1.2; // Default contrast value
    }

    let numGrainAmount = parseInt(grainAmount, 10);
    if (isNaN(numGrainAmount)) {
        numGrainAmount = 10; // Default grain amount
    }
    numGrainAmount = Math.max(0, numGrainAmount); // Ensure grain amount is not negative

    // Get image data
    const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
    const data = imageData.data;

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

        // 1. Convert to grayscale (luminosity method)
        // Formula: gray = 0.299*R + 0.587*G + 0.114*B
        let gray = 0.299 * r + 0.587 * g + 0.114 * b;

        // 2. Apply Contrast
        // Adjusts contrast around mid-gray (127.5).
        // A contrast factor of 1.0 means no change. Greater than 1.0 increases contrast.
        if (numContrast !== 1.0) { // Apply only if contrast factor is not neutral
            gray = (gray / 255.0 - 0.5) * numContrast + 0.5;
            gray *= 255.0;
        }
        
        // 3. Add Film Grain
        if (numGrainAmount > 0) {
            // Generate random noise. (Math.random() - 0.5) gives range [-0.5, 0.5).
            // So, noise is in range [-numGrainAmount/2, numGrainAmount/2).
            // E.g. if numGrainAmount is 10, noise is between -5 and +5.
            const noise = (Math.random() - 0.5) * numGrainAmount;
            gray += noise;
        }

        // Clamp the grayscale value to be within [0, 255]
        gray = Math.max(0, Math.min(255, gray));

        // Set the new RGB values (all to gray for B&W)
        data[i] = gray;
        data[i + 1] = gray;
        data[i + 2] = gray;
    }

    // Put the modified image 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

The Image Fomapan 100 Filter Effect Application is a tool designed to transform images by applying a Fomapan 100 film effect. This includes converting the image to grayscale, enhancing contrast, and adding a film grain effect. It’s ideal for photographers and designers looking to achieve a classic film look in their digital images, perfect for recreating the nostalgic aesthetics of black-and-white photography.

Leave a Reply

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

Other Image Tools:

Image Lens Flare Filter Effect Tool

Image Ilford XP2 Super Filter Effect Application

Image Cinemascope Filter Effect Applicator

Image Dubblefilm Solar Filter Effect Application

Image Night Vision Filter Effect Tool

Image Tintype Filter Effect Application

Image Color Graduated Filter Effect Tool

Image Agfa Vista Filter Effect Application

Image Schneider Hollywood Black Magic Filter Effect Tool

Image TMax 400 Filter Effect Tool

Image Double Exposure Filter Effect Tool

Image Fujichrome Velvia 50 Filter Effect Application

Image Revolog Texture Film Filter Effect Tool

Image Lomography Metropolis Filter Effect Application

Image Variable ND Filter Effect Tool

Image 8mm Movie Film Filter Effect Application

Image TMax 100 Filter Effect Application

Image Fog Filter Effect Tool

Image Ektachrome E100 Filter Effect Application

Image RED Cinema Camera Filter Effect Tool

Image Reverse Graduated ND Filter Effect Tool

Image Kaleidoscope Filter Effect Tool

Image Platinum Palladium Print Filter Effect

Image Light Leak Filter Effect Tool

Image Moire Pattern Filter Effect Tool

Image Pull Processing Filter Effect Tool

Photo Ambrotype Filter Effect Tool

Image Cross-Screen Star Filter Effect Tool

Image Tiffen Ultra Contrast Filter Effect Application

Photo Telephoto Lens Compression Filter Effect Tool

Image Leica M6 Camera Render Filter Effect

Image Cokin Sunset Filter Effect Application

Image CineScope Aspect Ratio Filter Effect Tool

Image Ilford FP4 Plus Filter Effect Tool

Image Infrared 850nm Filter Effect Tool

Image Pentax 67 Medium Format Filter Effect Tool

See All →