Vibe coding a Negative Converter

Soo, I vibe coded my own Negative converter on my lunch breaks and I’m shocked and floored at how good it is. I have used NLP since the beginning and I have waited and waited for the standalone version. It was the only thing holding me back from ditching Lightroom for good. So just yesterday, just for fun, I vibe coded a Dark Room that imports raw files and lets you prep the negatives, reverses the negatives perfectly with all the tools I could think I needed and I have a dust removal module where I can spot remove all the little dust spots and it’s super fast and smooth to work with. I have no technical ability, just confidence in my taste and my ability to express what I feel. It didn’t take even a day. I will still buy the NLP standalone version when it comes out, I hope it will still be better because it brings deeper technical knowledge that I don’t have. But the landscape has changed forever now and I truly wish Ai was never invented.

1 Like

Can you add a few screens showing the app, negative and conversion?

(onverters appear like mushrooms after rain. Not all are good to eat though)

Hmm I could but I don’t feel comfortable with that, it’s NLPs forum. I’ll might do a YouTube video about it. But you can try it for yourself, it’s surprisingly easy. I’m mostly shocked and I’m worried about developers. I’m also surprised how deep it went. It created synthetic negatives and grain structures to create the tools and read through all kinds of scientific papers. It’s not something I’m going to share or anything. I was just going to build a website with Ai and now I’m rebuilding Lightcraft to fit my exact needs. It’s weird but here we are.

Hmm, I vibe code negative inverter a while ago with ChatGPT and it was fun - though it was not just couple of hours and I had to pour in all I knew about conversion. Today, inspired by this topic I on the spot decided to see how far things improved. It’s true that now negative converters grow in bunches on GitHub tree ;-). Anyway , I opened Claude and entered the following prompt:

Vlad:

"Suppose I ask you to create application to convert negative images into positives. The images will be taken with digital camera in raw mode using macro lens from masked negative film. Certain part of film rebate around frame will be captured as well. Please outline the steps you will be taking, ask questions you need to build right application and provide the description of pipeline you woul build along with names of packages which would be used and there purpose.

Here is the lengthy response which sort of give one an idea what AI now capable of:::

Claude:

Below is how I’d approach it: the questions I’d need answered first, the processing pipeline, and the packages behind each stage.

## Steps I’d take

1. **Settle requirements** using the questions below. Many of them change the math, not just the UI.

2. **Collect a reference set.** I’d want sample RAWs from your rig plus calibration frames: a flat field, a light-source-only frame, and ideally a color chart shot on the same film stock.

3. **Prototype the core pipeline** as a Python library (no GUI) and validate it numerically against the reference frames.

4. **Add roll-level processing.** One base/mask measurement drives every frame on the roll, which keeps color consistent.

5. **Wrap it** in a CLI for batch work, then a GUI with live preview, and package it per platform.

6. **Test** with synthetic negatives (known densities) and real rolls.

## Questions

- **Camera and RAW format:** CR3, NEF, ARW, RAF (X-Trans), or DNG? Will you use pixel-shift or multi-shot capture?

- **Light source:** high-CRI white LED, or narrowband RGB? Is it a single exposure, or three separate R/G/B exposures merged? Narrowband light largely removes the need for crosstalk correction.

- **Rebate content:** do the captures include sprocket holes (clear light, which gives the 100% transmission reference) as well as unexposed base (D-min)? Ideally both.

- **Films:** C-41 only, or also ECN-2, B&W, and E-6? Should the app identify the stock from edge print or DX code?

- **Formats:** 35mm only, or 120 and sheet film too? Will you stitch multiple shots per frame?

- **Flat field:** can you shoot one per session? If not, I’d fall back to lens profiles.

- **Output intent:** neutral scene-referred linear output for later grading, or a rendered “print-like” look? Which color space (Rec.2020 linear, ProPhoto, ACES, sRGB)? Should the output be a 16-bit TIFF or a linear DNG?

- **Workflow:** fully automatic batch, or per-frame adjustments? Does it need to coexist with Lightroom or Capture One?

- **Platform:** macOS, Windows, or Linux? Is GPU acceleration expected? What are typical roll and batch sizes?

- **Extras:** dust removal (no IR channel is available with a camera), auto-crop, deskew?

## Pipeline

The core principle is to work in linear camera RGB, convert to density, and remove the mask by subtraction in density space. Simple inversion with curves doesn’t handle the mask correctly.

1. **RAW decode.** Get linear camera-native RGB with no white balance, no gamma, no auto-brightness, and black level subtracted. Clipped pixels get flagged. Camera RGB acts as a three-channel densitometer, so I’d avoid any early conversion to a color space.

2. **Flat-field correction.** Divide by the light-only frame to remove vignetting and backlight unevenness.

3. **Geometry and region detection.** Find the frame, sprocket holes, and unexposed rebate, then deskew and crop. Those regions supply the reference values for the next stages.

4. **Density conversion.** Per channel, compute D = −log10(I / I₀), where I₀ comes from the sprocket hole or light frame.

5. **Base/mask removal.** Subtract per-channel D-min (base, fog, and mask) measured in the rebate. This is measured once per roll and applied to every frame.

6. **Crosstalk correction.** Apply a 3×3 matrix in density space to compensate for the mismatch between the camera sensor’s spectral response and the dye layers (or Status M). The matrix is fitted from the color-chart calibration and is close to identity when using RGB narrowband light.

7. **Gamma alignment and inversion.** Normalize the per-layer contrast (slopes) so neutrals stay neutral across the whole density range. Then convert back to relative log exposure and to a linear positive. Grey balance comes from a reference patch, or from roll-wide statistics in log space.

8. **Color space and rendering.** Matrix the result into the working space. Optionally apply a tone curve or print-emulation LUT.

9. **Output.** Write a 16-bit TIFF with an embedded ICC profile or a linear DNG, copy the metadata, and keep a sidecar JSON with all parameters so processing is non-destructive and re-renderable.

10. **Validation.** Compute ΔE2000 against the chart reference. Resolution and focus checks would use test targets.

## Packages

**RAW and metadata**

- **rawpy** (LibRaw): RAW decoding to linear 16-bit, including X-Trans.

- **PyExifTool**: reading and copying EXIF/maker notes.

- **lensfunpy**: vignetting and distortion correction when no flat field is available.

**Image math and color**

- **numpy / scipy**: core array math, curve fitting, and solving for the crosstalk matrix (`scipy.optimize`).

- **OpenCV**: frame, sprocket, and rebate detection (thresholding, contours, Hough lines), deskew, inpainting for dust.

- **scikit-image**: alternative segmentation and morphology, plus image quality metrics.

- **colour-science**: color space matrices, chromatic adaptation, transfer functions, ΔE, chart utilities.

- **colour-checker-detection**: automatic chart patch extraction for calibration.

- **OpenColorIO** (optional): ACES pipelines and LUT-based print looks.

**Output**

- **tifffile**: 16-bit/float TIFF writing.

- **Pillow (ImageCms)**: ICC handling and JPEG previews.

- **PiDNG**: linear DNG output, if that’s chosen.

**Performance**

- **numba** or **CuPy**: speeding up per-pixel stages, on CPU or GPU respectively.

- **concurrent.futures / joblib**: parallel batch processing.

**Application layer**

- **pydantic + PyYAML**: roll profiles, settings, and parameter sidecars.

- **Typer**: the CLI.

- **PySide6 (Qt)**: the GUI with a downscaled live preview.

- **pytest**: tests, including synthetic-negative fixtures.

- **PyInstaller or Briefcase**: platform installers.

The answers to the light-source and rebate questions matter most. They decide whether stages 4–6 can be fully measured or have to be estimated.

_-------

Vlad:

So you can see much of the response makes sense and certain aspect demonstrate good understanding of the task, so yes - having converter built is not really a big deal if you know what to ask :wink:

@Digitizer

…we look how apps that try to replace others are coming on. Had a look at RapidRAW and its built-in converter and I got the Impression that more will be coming.

Remains to be seen how support and legal aspects will evolve. I suppose that not all devs want to walk the open source road. Not all users either. Opportunities here and there!

It seems that Ai made a huge leap forward around three months ago. Two years ago I tried to get ChatGPT to make scripts for me to be used in Houdini (3D software) and it was unusable. Now there seems to be no limit to what it can do. I think now expertise in the subject is what counts the most. I could ask the right questions because I knew what I wanted and I got everything that I needed and a lot more. I think there is where someone like Nate can compete, deep knowledge in the subject. Probably the best one to make a converter is a really old analog master who knows exactly what is needed.

I used Claudes free tier only and I did run out of tokens pretty fast but five hours later they are replenished and I can keep going. The paid Opus is even more powerful.

The Negative Converter is a completely standalone app no connection with Lightroom or Lightcraft so unless they ban Ai it should be legal. My friend over at Apple says they haven’t written a line of code for more than a year now. But I don’t think I would be buying someone’s vibe coded software any time soon. I suppose support is not going to be all that good.

1 Like

There is an interesting aspect of open source. I think for developer the only way to get their product adopted is by making it open source . Open source gives the users at least a potential to look at the source and evaluate it from security point of view. I am extremely reluctant to put closed-source anything on my computer from small unknown source. I have not tried these Photoshop Lightroom replicas on rust because I don’t believe the whole effort to mimic all 600+ menu items in Photoshop can be just a free gift to humanity. The whole enterprise - no matter how many agents involved and how little time person spent - still supposed to be huge.

At some point down the road the next automatic update will bring down payload you certainly don’t want to have on your computer but it will be too late.

With open source there is at least the chance that suspicious packages with unknown provenance can be flagged in timely matter.

Of course only 5% of users will be willing and capable of spotting bad things but still it’s better than nothing.

Sorry if you already tired of me making these rants.

No problem. You address an aspect that I care about only indirectly. I trust open source from a security point of view, because there are people out there looking for exactly those aspects.

My main interest is located in these areas:

  • does it do what I need?
  • can I work with it (UI/UX)?
  • what support does it provide?

We know what we have with @nate’s NLP and we don’t with all the new AI apps.

At one point, Nate might like/have to get out of NLP and sell it or leave it as is. Then what?

2 Likes