Please bookmark this page to avoid losing your image tool!

Image ORWO NP22 Film 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.8, grainIntensity = 20) {
    // Ensure parameters are valid numbers, using defaults if not.
    let numContrast = Number(contrast);
    if (isNaN(numContrast) || numContrast < 0) {
        console.warn(`Invalid contrast value "${contrast}". Using default 1.8.`);
        numContrast = 1.8;
    }

    let numGrainIntensity = Number(grainIntensity);
    if (isNaN(numGrainIntensity) || numGrainIntensity < 0) {
        console.warn(`Invalid grainIntensity value "${grainIntensity}". Using default 20.`);
        numGrainIntensity = 20;
    }

    // Create a canvas element
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');

    // Get image dimensions. HTMLImageElement properties.
    // Use naturalWidth/Height for actual image dimensions, not styled dimensions.
    const imgWidth = originalImg.naturalWidth || originalImg.width;
    const imgHeight = originalImg.naturalHeight || originalImg.height;

    // Set canvas dimensions
    canvas.width = imgWidth;
    canvas.height = imgHeight;

    // Handle cases where image dimensions are not available (e.g., image not loaded yet)
    if (imgWidth === 0 || imgHeight === 0) {
        console.error("Image dimensions are 0. Ensure the image is fully loaded before processing.");
        // Draw a placeholder or return an empty canvas
        ctx.fillStyle = 'rgba(128,128,128,0.5)';
        ctx.fillRect(0,0,canvas.width,canvas.height); // will be 0x0 if dimensions are 0
        ctx.fillStyle = 'black';
        ctx.textAlign = 'center';
        if (canvas.width > 0 && canvas.height > 0) { // Only draw text if theres space
             ctx.fillText('Error: Image not loaded.', canvas.width/2, canvas.height/2);
        }
        return canvas; // Returns a 0x0 canvas if image has no dimensions
    }

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

    // Get the image data from the canvas
    let imageData;
    try {
        imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
    } catch (e) {
        console.error("Could not get image data. This might be due to cross-origin image restrictions.", e);
        // Draw an error message on the canvas
        ctx.fillStyle = 'rgba(200, 0, 0, 0.7)'; // Semi-transparent red
        ctx.fillRect(0, 0, canvas.width, canvas.height);
        ctx.fillStyle = 'white';
        ctx.textAlign = 'center';
        ctx.font = `bold ${Math.min(24, canvas.width / 20)}px Arial`;
        ctx.fillText('Error processing image.', canvas.width / 2, canvas.height / 2 - 20);
        ctx.font = `${Math.min(16, canvas.width / 25)}px Arial`;
        ctx.fillText('Possibly a cross-origin issue.', canvas.width / 2, canvas.height / 2 + 10);
        return canvas;
    }
    
    const data = imageData.data; // This is a Uint8ClampedArray

    // 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 channel (data[i+3]) is preserved

        // 1. Convert to grayscale (Luminance method)
        let gray = 0.299 * r + 0.587 * g + 0.114 * b;

        // 2. Apply contrast
        // Formula: NewValue = factor * (OldValue - 128) + 128
        gray = numContrast * (gray - 128) + 128;

        // 3. Add film grain
        // Generates a random value between -numGrainIntensity/2 and +numGrainIntensity/2
        const grain = (Math.random() - 0.5) * numGrainIntensity;
        let finalValue = gray + grain;

        // 4. Clamp the value to the 0-255 range
        finalValue = Math.max(0, Math.min(255, finalValue));
        
        // Set the new RGB values (all same for monochrome)
        data[i] = finalValue;
        data[i+1] = finalValue;
        data[i+2] = finalValue;
    }

    // Put the modified image data back onto the canvas
    ctx.putImageData(imageData, 0, 0);

    // Return the canvas with the applied effect
    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 ORWO NP22 Film Filter Effect Application tool enables users to transform their images by applying a vintage film filter effect reminiscent of ORWO NP22 film. This tool enhances the image by adjusting its contrast and adding a grainy texture, creating a distinctive monochrome appearance. It’s suitable for photography enthusiasts and artists looking to achieve a classic, retro look for their images. Whether for personal projects, social media posts, or creative presentations, this filter can help evoke nostalgia and artistic flair.

Leave a Reply

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

Other Image Tools:

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

Image Canon AE-1 Film Camera Render Effect

Photo B+W Dark Red #29 Filter Effect Application

Image Toy Camera Effect Enhancer

Photo Graflex Speed Graphic Filter Effect Tool

Image Konica Hexar AF Filter Effect Application

Image Ricoh GR Film Camera Filter Effect Application

Image Kodak Disposable Camera Filter Effect

Image Hoya Pro ND Filter Effect Application

Image Wratten #12 Yellow Filter Effect Tool

Image AGFA APX 100 Film Filter Effect Tool

Image Singh-Ray Vari-ND Filter Effect Application

Image Rollei RPX 25 Film Filter Effect Tool

Image 35mm Half-frame Camera Filter Effect

Image Kodak Vision3 250D Motion Picture Film Effect Filter

Image 120 Film Format Filter Effect

Image Lens Whacking Filter Effect Tool

Image Black and White Red Filter Effect Tool

Image Lee Medium Stopper 6-Stop ND Filter Effect Tool

Image Nikon F3 Film Camera Render Effect Tool

Image Polaroid Spectra Filter Effect Tool

Image Contax T2/T3 Filter Effect Application

Image Bronica ETRS Medium Format Filter Effect Application

Image Soap Bubble Bokeh Effect Generator

Image Center Graduated ND Filter Effect Tool

Image Breakthrough Photography X4 ND Filter Effect

Photo Filter Effect Creator for Yashica T4 Point-and-Shoot

Image AGFA APX 25 Film Filter Effect Tool

Image Singh-Ray Gold-N-Blue Polarizer Effect Tool

Image Black and White Blue Filter Effect Tool

Image Pinhole Solargraphy Effect Creator

Image Kodak Vision3 500T Motion Picture Film Effect Simulator

Image Soft Focus Filter Effect for Nikon Nikkor

See All →