To learn a film sim, ask the camera. Then ask it again.
How an X100V, wired to a computer and fed test images it took for photographs, was measured pass after pass until its seventeen film simulations could be rebuilt in a browser.
Fig. 1. The rig.
- 1 The X100V. Its own image engine does every render, so what comes back is the real film simulation, not anyone’s idea of it.
- 2 A USB cable, with the camera set up for tethered RAW conversion: a synthetic RAF goes in, the rendered JPEG comes back.
- 3 The computer, driving the camera with grawji. It builds each test image and reads back the colour of every patch.
A Fujifilm camera applies its film simulations inside its own image engine, and Fujifilm doesn’t publish what that engine does. A photo’s built-in JPEG has the look it was shot with baked in. To show the same photo as Velvia or Classic Chrome without the camera, you need to know what the engine does to every colour, at every setting. So we asked it, about a thousand renders at a time, and kept asking, pass after pass, to get as close as we could.
Pass after pass
Nothing here was settled in one go. Every stage ran the same loop: render on the camera, measure what came back, fit the model to it, and compare the model with the camera’s own output. Wherever the two disagreed, the next pass went after the difference with new renders. Every camera stage can be resumed, so a pass could be rerun without starting over.
The passes below run from the lens, through the colour tables, to grain and noise.
Step by step
-
Rig the camera
The X100V can develop RAW files sent to it over USB. That makes the camera itself the renderer: anything it sends back has been through its own film simulation engine. A computer drives it with grawji, an open-source tool that talks to the camera, builds the test files and collects every render.
-
Make test images it takes for photographs
Each test image starts as a real, uncompressed RAF from the camera, a carrier. Its raw pixels are replaced with chosen values: white-balanced linear levels, as fractions of the green clip level. Each colour filter site gets its level divided by the carrier’s as-shot white balance gain for that colour, so when the engine applies that white balance, the values come out neutral again.
There are three carriers, shot at DR100, DR200 and DR400, because the DR setting changes what the engine does.
-
First pass: the lens
The engine corrects the lens as it renders. It brightens the frame towards the corners by g(r) = 1 + 0.317r2 + 0.130r4 − 0.072r6, with r measured out to the half-diagonal, and its distortion correction moves points by a few pixels. A grey ramp, a flat grey and a grid of dots measured both.
From then on, each patch is divided by the gain at its position, so it reaches the engine at the level intended, and sampled where the distortion model puts it.
-
Second pass: the charts
The main chart holds about 12,000 patches per carrier over three frames of 64-pixel patches: a 17 × 17 × 17 grid in log steps, a 160-step neutral ramp and 7,300 random colours. Each carrier’s chart was rendered with every film simulation at every DR it allows, about 300 renders, and each patch read back as the mean of its 10 × 10 pixel centre.
Provia
Velvia
Classic Chrome
AcrosFig. 2. One chart, four film simulations. A chart laid out like the measurement charts, a neutral ramp along the top and random colours below, put through the fitted Provia, Velvia, Classic Chrome and Acros tables. These are the model’s renders, not the camera’s. -
Third pass: every other setting
About 660 more renders on one chart frame swept the rest of the recipe: highlight and shadow tone, colour, colour chrome effect and FX blue, a few combinations of them, the white balance presets, Kelvin values, WB shift steps and exposure. What came back decided the shape of the model:
- A DR200 or DR400 shot is pushed one or two stops, and its look depends only on the film simulation and the DR setting.
- White balance, WB shift and exposure all act as gains on the scene before the film simulation, so each is measured once, as a gain.
- Tone, colour, colour chrome and FX blue act on the output of each colour film simulation, and their tables chain in any order, even at DR400.
- On the black-and-white simulations, highlight and shadow tone act on the scene instead.
-
Fit the tables
Every patch became a data point for a regularised least-squares fit: a lookup table per film simulation and DR, with a smoothness prior so it can’t wander between patches, and inverse tables fitted the other way round from the same patches. The tables index scene values in a log encoding from 2−14 to 4, where 1 is the DR100 clip level.
A whole recipe, chained, is evaluated once on a 33 × 33 × 33 grid of colours, and the photo passes through that single table.
-
Check the fit on patches it never saw
Before trusting the tables, the model’s assumptions were scored on chart patches held out of every fit. Forward tables averaged 0.1 to 0.4 ΔE2000, and chained setting tables 0.3 to 1.0 against renders with the settings combined. Under 1 is hard to see.
-
Score it against the camera, on real photos
Charts aren’t photographs, so the real test used 14 photos from the X100V and 9 saved recipes. The camera rendered each photo with each recipe, and that render is the truth the approximation is held to, compared as ΔE2000 on 780 × 520 downscales so it measures colour rather than texture.
One rule was settled here rather than on charts: re-rendering a shot taken on a fixed white balance preset, the camera’s Auto white balance reuses the levels the shot applied. It was settled on three of these same photos, so the white balance part of the test isn’t fully held out.
-
The texture pass
Colour was only half of it. Grain, clarity and sharpening were measured by rendering synthetic charts at every level. Noise reduction was fitted to the camera’s renders of 15 photos from ISO 160 to 3200 at every NR level, so the noise left in flat areas matches.
Then real photos sent it round once more. Clarity was retuned to leave most of the finest detail alone, as the camera’s does, and grain to fade to nothing at clipped white. Grain now lands within a few percent of the camera’s strength in mid tones, and sharpness and clarity change fine detail by about as much as the camera does, a little more on high-ISO DR200 and DR400 shots.
-
Into the browser
The model was ported from Python to plain JavaScript, and the port is tested against the Python model’s reference outputs. The browser decodes the RAF itself, with a decoder translated from LibRaw, develops the raw data and applies the recipe. Opening a 26 MP RAF takes about 5 seconds, and a full-size download about 15.
Nothing leaves your device. The page is only allowed to fetch its own files.
How close it gets
Mean colour difference from the camera’s own renders of the 14 test photos, as ΔE2000. Under 1 is hard to see; 2 to 3 is visible side by side.
| Conversion | Mean ΔE2000 | Spread |
|---|---|---|
| The photo as shot, doing nothing | about 5.8 | |
| From the raw data, each photo’s own recipe | 1.6 | 0.8 to 2.7 per photo |
| From the camera JPEG, full recipes, shots with tuned recipes | 1.50 | 95th percentile 3.47 |
| From the camera JPEG, full recipes, shots with plain settings | 1.16 | 95th percentile 2.70 |
| From the camera JPEG, film simulation only, plain shots | 0.53 |
What it leaves out
- One body. Only an X100V was measured. Other bodies share the film simulations, but their engines may differ, so they get the X100V’s looks.
- A few settings. Smooth skin, monochrome toning and D-range priority aren’t covered.
- DR Auto. For a shot on DR Auto, the app uses the DR the camera recorded, which hasn’t been checked against the camera.
- RAFs without raw data. These start from the camera’s JPEG, so clipped highlights stay clipped and grain, clarity, sharpness and noise reduction can’t change.