Skip to content

Latest commit

Β 

History

1,077 Commits

Folders and files

Repository files navigation

Film Negative β†’ Positive Converter

Negative Converter sample output

Negative Converter helps film photographers turn scanned or camera-digitized film into clean, natural-looking positives with a workflow made for everyday editing. It brings frame cleanup, film-aware conversion, roll consistency, finishing controls, and export into one focused workspace.

Whether you are reviewing a fresh roll, restoring family negatives, or preparing a consistent set for sharing, the app is designed to make film conversion feel fast, approachable, and dependable while keeping your photos private.

Simpler local workflow

HEIC import, automatic same-stock roll analysis, local semantic colour anchors, learned defaults, review filtering and consistent colour-profile export are available in the local workflow. CMYD remains a primary control above basic adjustments; Advanced reveals the optional tools. Desktop folder watching is optional. See the automation design, workflow guide and validation and remaining acceptance.

🌟 Features

  • πŸ“· Supports HEIC/HEIF, PNG/JPG file uploads (including 16-bit PNGs via UPNG.js and camera RAW files via LibRaw-Wasm: Canon CR2/CR3/CRW, Nikon NEF/NEFX/NRW, Sony ARW/SRF/SR2, Fujifilm RAF, Panasonic RW2/RAW, Olympus/OM System ORF, Pentax PEF, Leica RWL, DNG and more)
  • πŸ”„ Rotation correction via slider or number input
  • βœ‚οΈ Visual cropping with drag-and-drop overlay and a film-format ratio lock (135, 120, 4Γ—5/8Γ—10, 5Γ—7)
  • βš–οΈ One-click white balance by clicking a gray area in the image
  • πŸŽ›οΈ Live controls for:
    • Temperature & Tint
    • Vibrance & Saturation
    • Cyan / Magenta / Yellow (CMY) channels
  • 🎞️ Film presets for color negative, B&W negative, and positive slide stocks across Kodak / Fujifilm / Ilford
  • πŸ” Film edge reader: whole-strip scans that show the perforations get their DX edge barcode decoded (ISO 1007), the stock named from The Big Film Database, a matching preset suggested and the film base sampled from the unexposed rebate (see docs/film-edge-reader.md)
  • 🎞️ Roll analysis: analyse the selected frames together like a minilab β€” one film base and one tone analysis for the roll, a per-frame exposure offset, and frames that do not belong flagged as outliers (see docs/roll-analysis.md)
  • πŸ—‚οΈ Light table: grow the film strip into a thumbnail grid of the whole roll with stock and outlier badges, RAW thumbnails and keyboard navigation (see docs/light-table.md)
  • πŸ”¬ Darkroom paradigm: a test strip of patches along one axis (click to apply), enlarger controls with CMY filtration, exposure in stops and multigrade paper grades, a dodge & burn brush applied in linear light before the curves and at full resolution on export, and paper emulation for RA-4 and B&W papers with toning (see docs/darkroom.md)
  • πŸ“· Camera scanning: a flat field from a blank light-pad frame removes the pad's falloff before inversion, a lab scan of the same frame is aligned and its look fitted as a colour matrix plus curves, 2–5 shots of one frame merge as a noise-averaged or HDR 16-bit file, and a live loupe converts the camera feed through the current recipe and captures into the photo list (see docs/camera-scanning.md)
  • πŸ—ƒοΈ The roll's home: film stock, ISO, camera, lens, lab and frame numbers written into EXIF/XMP (AnalogExif schema) on every export, a printable 300 dpi contact sheet with sprockets and frame numbers, a project file that saves and reopens the whole roll (with an IndexedDB recovery copy), and shareable conversion recipes as short codes or QR (see docs/roll-home.md)
  • πŸ”¬ Technical depth: the Step-3 adjustments run at 16 bits on export so 16-bit PNG/TIFF carry real 16-bit data, a linear DNG export (inverted, film-base normalised, no tone curve) for Lightroom / Capture One, and on-device AI dust repair with bundled MI-GAN over the mask's tiles, falling back to TELEA (see docs/technical-depth.md)
  • πŸ§ͺ Expired film rescue: a separate entry and flow for aged rolls, negatives and positives alike β€” fog, overall cast, shadow/highlight crossover and lost speed are measured on the positive and corrected by density (a colour table over luminance plus one shared tone curve), and OpenCV.js measures what varies across the frame (uneven fog surface, local contrast), with a diagnosis and seven strengths on the preview, the 16-bit export and batch exports (see docs/expired-film-rescue.md)
  • πŸ—‚οΈ Data-driven preset system defined in negative2positive/src/silvercore/engine/FilmPresets.js (supports alias fallback for older preset IDs)
  • πŸ” Optional lens profile workflow: search/select Lensfun profiles manually, or skip lens correction and continue
  • 🧷 Roll-level lens settings: lens correction on/off and parameters can be applied to selected files or reused via roll reference
  • πŸ›‘οΈ Privacy-friendly: all image processing happens locally in your browser
  • πŸ’Ύ Flexible export: PNG / JPEG / TIFF with selectable bit depth (8-bit, plus 16-bit for PNG/TIFF)

πŸš€ How to Use

Workflow (Step 1 β†’ 3)

  1. Step 1: Crop
    • Rotate / Auto Frame / Crop until only the film area remains
    • Click Next: Film Settings (negatives) or Next: Positive Mode (slides)
  2. Step 2: Film Settings
    • Pick film type: Color, B&W, or Positive
    • Color negatives: set the mask baseline (sample manually / auto-detect / roll reference)
    • Click Next: Convert and Continue
  3. Step 3: Adjust & Export
    • White balance + sliders + curves to taste
    • Export PNG / JPEG / TIFF

Film type quickstart

  • Color negative: Step 1 β†’ Next: Film Settings β†’ keep Color β†’ set mask β†’ Next: Convert and Continue β†’ Step 3
  • B&W negative: Step 1 β†’ Next: Film Settings β†’ select B&W β†’ Next: Convert and Continue (no mask) β†’ Step 3
  • Positive slide: Step 1 β†’ Next: Positive Mode (or select Positive in Step 2) β†’ Next: Convert and Continue β†’ Step 3

Batch workflow (multiple files)

  1. Click Add and choose multiple images (File List appears)
  2. Process one frame fully to Step 3
  3. Use Save Settings for the current frame, or Apply to Selected for roll-wide settings
  4. (Optional) Use Set Current as Reference + Apply Reference to Selected for roll reference
  5. Export via Export All (ZIP) or Download All Individually

Guided Mode

  • Studio is the only workspace: automatic conversion, color-first controls, and dedicated Crop / Retouch / Border / Convert tabs.

βš™οΈ Technical Highlights

  • Uses UPNG.js to decode 16-bit PNGs
  • Uses the libraw-wasm npm package to support camera RAW formats such as .cr2, .cr3, .nef, .nefx, .arw, .raf, .rw2, .orf, .pef and .dng (the full list is in negative2positive/src/app/importFormats.js)
  • Uses UTIF.js + an in-app PNG encoder path to support TIFF export and 16-bit PNG/TIFF output options
  • Color adjustment logic is based on RGB ↔ HSL and RGB ↔ CMY conversions
  • Film preset metadata lives in FilmPresets.js and is grouped dynamically by film type in the UI
  • Optional lens correction uses @neoanaloglabkk/lensfun-wasm with npm local assets first + CDN fallback
  • Auto frame detection uses @techstark/opencv-js loaded dynamically from the npm package asset URL
  • Performance optimizations include:
    • Cached DOM access
    • Offscreen canvas reuse
    • Throttled rendering with requestAnimationFrame

Live Demo

Film Negative β†’ Positive Converter

πŸ–₯️ Desktop App (Tauri)

This repo includes a Tauri wrapper to package the web app as an offline desktop application for Windows / macOS / Linux.

Development

npm ci
npm run dev:web

Vercel deployment (important)

This app must be deployed from the Vite build output, not by serving source files directly.

Required settings (as recorded in .vercel/project.json):

  • Root Directory: negative2positive
  • Install Command: npm ci
  • Build Command: npm run build:web
  • Output Directory: negative2positive/dist

npm run build:web generates negative2positive/dist (for local/Tauri) and also syncs it to root dist.

Because the Root Directory is negative2positive, Vercel reads negative2positive/vercel.json (cache and security headers); the repository-root vercel.json is not applied to the deployment.

If Vercel serves negative2positive/index.html directly, module imports like pako / utif / jszip will not resolve in browser and upload buttons can stop working.

Feedback endpoint

The header Feedback button posts to negative2positive/api/feedback.mjs (a Vercel serverless function) at /api/feedback/; the desktop app uses https://negative-converter.tokugai.com/api/feedback/. Keep the trailing slash: with trailingSlash: true Vercel answers /api/feedback with a 308, and the desktop app's cross-origin preflight fails on a redirect. The Vercel project's Root Directory is negative2positive, so functions MUST live under negative2positive/api/ β€” an api/ directory at the repository root is silently ignored. The function files the message as a GitHub issue labeled feedback. Configure in Vercel β†’ Project β†’ Settings β†’ Environment Variables:

  • FEEDBACK_GITHUB_TOKEN (required): fine-grained personal access token with Issues: Read and write and Contents: Read and write on the target repo. Contents is what lets attached screenshots be uploaded to the orphan feedback-assets branch, which must already exist β€” without it the issue is still filed but the images are silently dropped. Without the token entirely the endpoint returns 503 and the form shows the error state.
  • FEEDBACK_GITHUB_REPO (optional): owner/repo to file issues in; defaults to lexluthor0304/NegativeConverter.

The endpoint allows cross-origin calls only from the production domain, Tauri desktop webviews, and localhost dev servers.

Desktop dev (Tauri)

npm run tauri:dev

Build installers

npm run tauri:build

Build outputs are placed under:

  • src-tauri/target/release/bundle/

macOS installation troubleshooting

If macOS shows "Negative Converter is damaged and can't be opened", this is because the app is not yet notarized by Apple. Use one of these methods:

Method 1 β€” Terminal command (recommended):

xattr -cr /Applications/Negative\ Converter.app

Method 2 β€” Right-click open: Right-click (or Control-click) the app β†’ select Open β†’ click Open in the confirmation dialog.

Method 3 β€” System Settings: Go to System Settings β†’ Privacy & Security, scroll down and click Open Anyway next to the blocked app message.

Linux AppImage troubleshooting

  • Run AppImage directly, not with sudo.
  • The desktop app now applies AppImage-only runtime guards:
    • isolates GIO module loading to avoid host gvfs/GLib ABI mismatches
    • standard AppImage keeps DMABUF when render nodes are usable, and auto-falls back when not
    • compatibility AppImage (*_legacy-glibc235.AppImage) defaults DMABUF off for startup stability
  • Optional override for DMABUF behavior:
    • force enable: NEGATIVE_CONVERTER_DMABUF=on ./Negative\ Converter*.AppImage
    • force disable: NEGATIVE_CONVERTER_DMABUF=off ./Negative\ Converter*.AppImage
    • shared-memory transport: NEGATIVE_CONVERTER_DMABUF=shm ./Negative\ Converter*.AppImage sets WEBKIT_DMABUF_RENDERER_FORCE_SHM=1. WebKit keeps accelerated compositing and copies each frame through shared memory, instead of painting the whole page in software as off does. It is not yet the legacy default: that needs the startup matrix below.
    • a WEBKIT_DISABLE_DMABUF_RENDERER or WEBKIT_DMABUF_RENDERER_FORCE_SHM you set yourself always wins.
  • The terminal log shows the decision ([linux-compat] lines) and, once a photo is open, one [webview] line with the WebGL renderer, the decision, the WebKitGTK version and the starting preview tier. Include both in bug reports about sluggish sliders.
  • One [memory] line at startup shows the WebKitGTK memory limit the app applies before the window opens (half of RAM, so WebKit's 30 s cache and JIT purge starts at a quarter of RAM instead of 1.5 GiB), or WebKit defaults when /proc/meminfo could not be read.
  • When the webview composites in software (the legacy default, off, no render node) or WebGL is a software rasteriser (llvmpipe, SwiftShader), slider and curve drags preview at up to 1 MP and the full display resolution returns on release. Other hosts drop to that tier only when frames run slow. NEGATIVE_CONVERTER_FRAME_LOG=1 logs every drag's frame intervals and canvas size as [webview] lines.
  • Startup matrix for making shm the legacy default (Ubuntu 22.04 and Debian 12; Intel, AMD, NVIDIA proprietary; X11 and Wayland; each must start without a blank window or crash and create a WebGL context): not run yet.
  • If startup still fails on older distros, use the compatibility AppImage (*_legacy-glibc235.AppImage).

Release (GitHub Actions)

  1. Update versions:
    • src-tauri/tauri.conf.json
    • src-tauri/Cargo.toml
  2. Merge to main
  3. GitHub Actions automatically:
    • creates a vX.Y.Z tag
    • publishes a GitHub Release with the installers
    • (optional) syncs installers to Cloudflare R2 under negative-converter/release/vX.Y.Z/

Cloudflare R2 sync (optional)

If you want the release workflow to upload installers to R2, add one of these GitHub Actions secret sets:

Option A: R2 S3 API token

  • R2_ACCESS_KEY_ID
  • R2_SECRET_ACCESS_KEY
  • R2_BUCKET
  • R2_ENDPOINT (e.g. https://<accountid>.r2.cloudflarestorage.com/)

Option B: Cloudflare API token (no S3 keys)

  • CLOUDFLARE_API_TOKEN
  • CLOUDFLARE_ACCOUNT_ID
  • R2_BUCKET

πŸ’‘ Development & Contributions

Feel free to fork, open issues, or submit pull requests with ideas or improvements.
This tool is designed to be simple, fast, and modifiable.

πŸ“„ License

MIT License

πŸ™ Acknowledgments

Special thanks to LibRaw-Wasm by ybouane,
which made it possible to support various raw image formats such as .cr2, .nef, .arw, .dng, .raw, and .rw2 directly in the browser via WebAssembly.
Your work was an essential reference and greatly accelerated development.

HEIC/HEIF decoding uses the browser when supported, then the bundled libheif WASM decoder in a worker. See negative2positive/public/codecs/README.md for licence and replacement instructions.

The desktop app can decode RAW files with LibRaw 0.22.1 linked natively (used under CDDL-1.0; source in src-tauri/vendor/libraw, notices in negative2positive/public/licenses/raw-decoder-notices.txt). See docs/native-raw-decode.md.

Releases

Packages

Contributors

Languages