Please bookmark this page to avoid losing your image tool!

Photo Foma Retropan 320 Film Filter Effect Tool

(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 = 6, brightnessOffset = 0) {
  const canvas = document.createElement('canvas');
  // Using { willReadFrequently: true } can sometimes optimize performance for frequent getImageData/putImageData calls.
  const ctx = canvas.getContext('2d', { willReadFrequently: true });

  // Use naturalWidth/Height if available, otherwise fallback to width/height.
  // This handles cases where the img element might have CSS dimensions different from its actual content.
  const imgWidth = originalImg.naturalWidth || originalImg.width;
  const imgHeight = originalImg.naturalHeight || originalImg.height;

  // If image dimensions are invalid (e.g., image not loaded yet or is broken)
  if (imgWidth === 0 || imgHeight === 0) {
    console.error("Image has no dimensions or is not fully loaded.");
    // Return a tiny, empty canvas or handle error as appropriate for the application.
    // For this utility, we'll create a 1x1 canvas to prevent further errors.
    canvas.width = 1;
    canvas.height = 1;
    return canvas;
  }

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

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

  let imageData;
  try {
    // Get the pixel data from the canvas
    imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
  } catch (e) {
    // This can happen due to cross-origin restrictions if the image is from another domain
    // and the canvas becomes "tainted".
    console.error("Could not get image data, possibly due to cross-origin restrictions:", e);
    // Return the canvas with the original image drawn, as filtering is not possible.
    return canvas;
  }
  
  const data = imageData.data; // This is a Uint8ClampedArray

  // Iterate over each pixel (each pixel consists of 4 values: R, G, B, A)
  for (let i = 0; i < data.length; i += 4) {
    const r = data[i];
    const g = data[i + 1];
    const b = data[i + 2];
    // The alpha channel (data[i+3]) is preserved.

    // 1. Convert to grayscale using the luminosity method (approximates human perception of brightness)
    let gray = 0.299 * r + 0.587 * g + 0.114 * b;

    // 2. Apply contrast adjustment
    // The formula shifts values away from or towards the midpoint (128)
    // new_value = factor * (old_value - 128) + 128
    gray = contrast * (gray - 128) + 128;
    
    // 3. Apply brightness offset
    // This simply adds or subtracts a value to/from the pixel's brightness
    gray += brightnessOffset;

    // Clamp the gray value to the valid 0-255 range after contrast and brightness
    gray = Math.max(0, Math.min(255, gray));

    // 4. Add film grain
    if (grainAmount > 0) {
      // Generate a random noise value between -grainAmount and +grainAmount
      const noise = (Math.random() - 0.5) * grainAmount * 2;
      gray += noise;
      // Clamp the value again after adding noise
      gray = Math.max(0, Math.min(255, gray));
    }

    // Set the R, G, B channels to the new grayscale value
    data[i] = gray;
    data[i + 1] = gray;
    data[i + 2] = gray;
  }

  // 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

The Photo Foma Retropan 320 Film Filter Effect Tool is an online utility that transforms your images to mimic the classic aesthetic of retropan film photography. It allows users to adjust the contrast, add film grain, and modify brightness to create a retro-styled black and white effect. This tool can be particularly useful for photography enthusiasts looking to achieve nostalgic film-like images for personal projects, social media posts, or artistic expressions. It’s simple to use and provides a quick way to enhance photos with a vintage touch.

Leave a Reply

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

Other Image Tools:

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

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

See All →