Skip to content

Turning a negative into a positive

The app turns the RAW file of a frame shot on the scanner into a positive, saved as a 16-bit TIFF. Colour or black-and-white; no camera or Arduino needed.

Pick Convert at the top of the window. The picture takes the middle, with its tools on its left; the negatives run in a strip of thumbnails under it; the panel on the right has two tabs, This negative (what changes the one shown) and All negatives (what serves every one). Point at any control for a moment to see what it does and its key; ? lists the keys.

  1. Bring in the negatives. The RAW files of the latest scan of negatives come in by themselves when Convert is shown, during the scan or after. After a scan, Convert the N negatives, under Start scan, leads there.

    • Each file comes in once: one you remove (the cross on its thumbnail) stays out.
    • For others, use + at the start of the strip, or drag them from the file manager onto the window, in either view.
    • Files are never changed, and show as shot until converted.
    • Each thumbnail is marked once its negative is converted, adjusted (or turned, or given a frame of its own) and saved; the saved mark goes when something changes after the save.
    • A click shows a negative, Left and Right show the one before or after. Ctrl-click selects negatives, Shift-click selects the ones between, Ctrl+A selects them all and Esc none.
  2. Film base. Pick the yellow tool beside the picture (or press 1) and click on bare film (a gap or the rebate), or drag a rectangle over bare film only. A click measures a small square around it. The base serves every negative in the list, so they must be the same film; it is kept until the app is quit.

  3. Frame. Pick the green tool (2) and drag a rectangle just inside the frame, without rebate, gaps or film holder. The black and white points are measured there, and it is what the crop keeps.

    • Shape, under the picture while drawing frames, keeps the frame to a format’s shape whichever way round it is drawn: 3:2 (35mm and 6 × 9), 1:1 (6 × 6), 4:3 (6 × 4.5), 5:4 (6 × 7), 35mm panoramic, or free. A frame already drawn takes the new shape, the largest inside it, centred.
    • The first frame drawn serves every negative. Drawing or moving one after that changes it on the negative shown only, which then has a frame of its own. Under All negatives, the cross beside Frame takes that one away (the shared frame serves it again), and Use this frame for all makes it the frame of every negative without one of its own.
    • Drag inside a rectangle to move it, or an edge or corner to resize it; the film’s base too. Dragging outside draws a new one.
    • Move (the hand, H, or Esc from another tool) draws nothing: once zoomed in (the wheel, or a double click), dragging moves the picture. Space held, or the middle button, moves it with any tool.

    A negative as shot, with the film’s base and the frame drawn on it

    A black-and-white negative of a radio telescope, as the X-T5 shot it: the film’s base in yellow on the gap at the left, the frame in green.

  4. Positive. Under This negative, Positive (or Y) converts the negative shown; it then follows the clipping and what is drawn on it. As shot goes back, and holding B shows it as shot for as long as the key is down. With negatives selected, Convert in the strip turns them all into positives, or all back.

  5. Colour layers, under All negatives: how much contrast the film’s red and blue layers have, as a share of green’s (see step 2 below). They are measured on each negative, and shown greyed in the two fields. To set them for every negative in the list:

    • type them;
    • or Keep these for all: the ones measured on the negative shown;
    • or pick the blue tool (3) and click on things that were grey in the scene (a grey card, a white wall, a cloud, asphalt), or drag a rectangle over one. One grey is enough, the film’s base being another; more, from dark to light, give a surer result. Bare film is refused.

    Measure on each goes back to measuring them.

  6. Adjustments, under This negative, in groups that fold and stay as you left them: Tone (black point, white point, exposure, contrast, brightness), Colour (black and white, warmth and tint of the mid-tones, the shadows and the highlights, saturation), Curves, and Details (what was measured).

    • Drag a slider or type a value, -100 to 100; 0 changes nothing. Each negative keeps its own, and a folded group says how many of its own are changed.
    • The arrow beside a slider, or a double click on it, resets it; the arrow beside As shot and Positive resets them all.
    • The histogram shows the frame’s red, green and blue, and the share of it clipped to black and to white.
    • Pick a grey (the target beside the picture, G), then click on something that was grey in the scene: warmth and tint are set to make it grey. Esc stops.
    • Curves: click to add a point, drag it, double-click it to remove it. Dragging the bottom-left point to the right clips the shadows to black, the top-right one to the left the highlights to white. All acts on the three channels, R, G and B on one, before All. The arrow beside them straightens the curve picked.
    • Black and white removes every colour, whatever the film’s cast (a black-and-white film come out sepia, say), and saves a grey TIFF. Warmth and tint then act like a coloured lens filter, changing how light each scene colour turns out in grey. Saturation and the curves of one channel are greyed out.

    A positive with its adjustments in use, shown cropped to the frame

    Another negative of the roll, converted with the first one’s base and frame, then warmed, with a deeper black and brighter mid-tones, and shown cropped to the frame.

  7. Crop and turn. The crop tool beside the picture (C) shows only the frame, as kept; press it again to redraw or move the frame. Crop saved files to the frame, under All negatives and ticked at first, keeps only the frame in the TIFF. The two arrows ([ and ]) turn the negative shown a quarter turn, on the screen and in the saved file, after the crop. Each negative keeps its own, and what is drawn on it turns with it.

  8. Copy to others. The copy button beside Save (or in the strip, with negatives selected) gives other negatives the settings of the one shown. Tick what to copy: tone, colour, curves, rotation, frame, each shown with its value; a part with nothing set puts theirs back to none. Then pick the negatives selected, or every other one. What was ticked is kept for next time.

  9. Save (or S) the negative shown, or, in the strip, Save all (Save N when negatives are selected), converted on the screen or not. Files go to the scans’ folder, named after the RAW file: DSCF0012_positive.tif. Saving again replaces the file.

Under This negative, the warnings say when a channel was clipped in the scan, a scan was shot far too dark, a negative is thin, or film holder shows inside the frame area. Details shows the base, white balance, black and white points, and the layers used (“set” when they were not measured).

rollscan convert does the same to one file:

rollscan convert DSCF0012.RAF \
--base 6620,6880,500,4500 \
--frame 1560,6480,120,5040
  • --base x0,x1,y0,y1: bare film, a gap or the rebate. Without it, the clearest film in the picture is used, which is wrong when bare light shows around the film or through a sprocket hole.
  • --frame x0,x1,y0,y1: the frame, without rebate, gaps or holes. Default: the middle of the picture.
  • --layers r,b: red’s and blue’s layer contrast as a share of green’s. Default: measured on the frame. --layers-from x0,x1,y0,y1, given once or more, solves them from areas that were grey in the scene.
  • --clip-shadows 0.5, --clip-highlights 0.001: percent of the frame clipped to black and to white, per channel.
  • --black r,g,b, --white r,g,b: black and white points by hand, as the command prints them. --black-at, --white-at take an area of the negative instead.
  • --base-rgb r,g,b: a base measured before, as the sensor reads it.
  • --black-point, --white-point, --shadow-warmth, --shadow-tint, --highlight-warmth, --highlight-tint, --warmth, --tint, --saturation, --contrast, --brightness, --exposure: adjust the positive, -1 to 1; 0 changes nothing.
  • --grey-at x0,x1,y0,y1: an area to come out grey: sets warmth and tint.
  • --curve 0:0,0.5:0.6,1:1: a curve through points x:y, 0 to 1, on the three channels, flat before its first point and after its last; --curve-red, --curve-green, --curve-blue on one.
  • --black-and-white: a grey TIFF.
  • --rotate 90: turn the saved positive clockwise, 90, 180 or 270 degrees.

It prints the base, white balance, layers and both points, so a whole roll can share them.

The RAW file as the sensor measured it: black level removed, scaled so 1.0 is the sensor’s ceiling, colours filled in at every pixel (Markesteijn’s method, one pass, on Fujifilm’s X-Trans; the reading library’s choice on other sensors). No white balance, colour matrix, colour profile or curve, so a value is proportional to the light through the film.

Everything is done channel by channel.

base = (Rb, Gb, Bb) is each channel’s median over the bare film, unmoved by dust or a scratch there.

Every value is divided by it: t = value / base, 1 on bare film in every channel. A colour negative’s orange mask scales every pixel by the same amount per channel, exposed or not, so this removes it. It also makes how bright the negative was shot not matter: a scan two stops darker gives the same t.

The white balance shown, wb = Gb / base (green unchanged), is the same thing seen from the sensor.

t' = t ^ (1 / layer), with layer = 1 for green.

Each dye layer of a colour film has its own contrast: on a frame of the X-T5 shot on 120 film, blue’s density range was 1.33 times green’s and red’s 0.81 times. The levels below make the darkest and the brightest tones neutral, but not those between: blue rises faster than green and the mid-tones turn blue. Bringing each layer to green’s contrast makes a grey grey all the way.

layer is measured on the frame: the slope of the channel’s density over the base against green’s, a straight line fitted across the frame’s film that takes neither channel for exact. A flat frame (green’s densities spreading less than 0.03) is left at 1. From greys picked by hand, the line goes through the base, a grey too: layer = Σ d · d_green / Σ d_green² over the greys.

Both are held between 0.5 and 2. A black-and-white film measures close to 1.

lin = 1.04 * 0.01 * (1/n - 1/n_sat), with n = 0.124 * t', never below 0.

Less light through the film means more from the scene: the positive is the negative’s reciprocal. 0.124 is what the base read in green on the scans the constants were measured on, so those convert as they did. n_sat, the white balance’s largest term, puts a sensor at its ceiling at exactly black. No light reads as one sensor step, so nothing divides by zero.

lin is not held at 1: the densest parts of a negative stay apart from each other until the levels.

e = 1.075 * sqrt(lin) - 0.075, and 3.8521 * lin below lin = 0.01947, where the two meet.

The square root spreads tones the way the eye tells them apart, so the levels act evenly from shadows to highlights. The straight part near black keeps its noise from being stretched.

Per channel, lo is the value 0.5 % of the frame lies below, hi the one 0.001 % lies above. Then w = 0.02 + (e - lo) / (hi - lo) * 0.96: black and white points land just inside black and white, with a little room at both ends. What lies past them is held at black or white at the end, after the adjustments.

This removes the colour cast left at both ends, whatever is left of the mask and whatever the scene’s light.

They are measured:

  • In the frame alone. Rebate, gaps and holes are bare base, and a holder lets nothing through: either would set a point alone. Anything taken for holder is left out, with a warning: draw the frame then.
  • On a small copy. Grain is far stronger than the tones under it, most of all in the positive’s highlights. The picture is shrunk to 2000 pixels on its long side at most (4 times for a 40-megapixel camera), each pixel the mean of those it replaces: tones, not grain. The app shows that copy, so what is saved is what was shown. The layers are measured on the same copy.
  • With almost no highlight clipping. Dust is opaque, so white and small in the positive; 0.001 % gets past it only on a clean frame. On a dusty one the white point lands on the dust and the picture comes out dark: clip more highlights.

A black or white point forces that tone neutral. On a sunset or under a forest canopy, where nothing was neutral, that removes a colour the scene had.

See below. The curves come last, on the values held between 0 and 1.

light = w ^ 1.8, then the sRGB curve, written on 16 bits a channel.

Before the inversion, everything acts backwards: brightening the negative darkens the positive, warming it cools it. So adjustments act on the positive, after the levels and before the decoding, in this order:

Adjustment What it does At its end (100 in the app, 1 on the command line)
Black point Moves every channel’s black point up into the picture: a deeper black A quarter of the way to the white point
White point Moves every channel’s white point down into the picture: a brighter white A quarter of the way to the black point
Shadows: warmth, tint Moves each channel’s black point its own way: warmth lowers red’s and raises blue’s, tint (magenta) raises green’s and lowers the others’ A twentieth of the way, red and blue; tint moves green that far and the others half
Highlights: warmth, tint The same with the white points The same
Warmth Raises each channel to its own power: more red and less blue in the mid-tones Red’s exponent 0.71, blue’s 1.41
Tint The same between green and the two others: more magenta above 0, more green below Green’s exponent 1.41, the others’ 0.84
Saturation Moves each pixel away from its own grey, or towards it Twice as far; -1 is no colour at all
Contrast An S-curve through mid-grey (18 % light): darker below it, brighter above, or the reverse The slope at mid-grey doubled, or halved
Brightness Raises the three channels to one power Exponent 0.5
Exposure Multiplies the light, black included Two stops: four times the light, or a quarter
Curves Through the points given, smooth and never overshooting them, flat before the first and after the last; a channel’s own curve, then the one for all

Warmth, tint, contrast and brightness are powers between the picture’s black and white (the levels’ two targets), which stay put. So unlike a white balance on the negative, warmth and tint don’t undo the levels: the levels set the ends, these the middle. The grey picker solves warmth and tint so that the area picked comes out with its three channels equal; the adjustments after them keep a grey grey.

Saturation makes up for the missing camera colour profile, which leaves colours less saturated than they were.

In the app, adjustments, rotation and the frames of their own are per negative and forgotten on quit, like the list. The base, the shared frame, the layers and the clipping serve the whole list.

Case What is done
Brighter than the sensor’s ceiling once balanced Black
No light at all Read as one step of the sensor: very bright, never infinite
A channel clipped in the scan Converted anyway, with a warning: shoot with less exposure
The base reads under a sixteenth of the sensor’s ceiling Converted anyway, with a warning: shoot with more exposure, the densest parts will be noisy
The film holder in the frame area Left out of the levels, with a warning: draw the frame
A thin or flat negative The measured points of a channel are never closer than 0.05, and the app says so; the layers are left at 1
One colour fills the frame The levels over-correct, and the layers measured on it are wrong: give --black, --white and --layers taken from a neutral frame of the same roll, or keep that frame’s layers for every negative
A grey picked on bare film Refused: it says nothing of the layers
Dust and scratches Left out by the clipping, as long as they cover less than it
  • The camera’s colours. The positive is in the sensor’s colours, written as sRGB, with no camera matrix or colour profile. Greys are grey; colours are undersaturated.
  • Each dye’s colour beyond its contrast. Each dye also absorbs outside its band; the layers’ contrasts are evened out, not that.
  • Sharpening, noise reduction and lens corrections.

The constants (1.04, 0.124, the encoding, 1.8, the two targets, the two clippings) come from converting real negatives shot with a Fujifilm X-T5. The method doesn’t depend on the camera, but 1.04 and the clippings may suit another a little less. The clippings and the layers are settings.

  • cargo test negative converts synthetic step wedges with an orange base: a grey film and a colour film whose three layers have different contrasts both come out grey at every step, the same negative shot two stops darker gives the same positive, its densest steps stay apart, the layers are measured or solved from greys, the levels come from the frame, and dust and the holder don’t move them.
  • On real film: convert a shot of a grey card or step wedge, and check it is grey with every step told apart.