#30 - A black and white checkbox in the Convert tab, with a grey TIFF #32

Merged
eliott merged 1 commit from feat/30-black-and-white into main 2026-11-20 00:03:06 +01:00
Owner

Sits on top of #29: merge #29 first.

A Black and white checkbox at the top of the Convert tab's adjustments takes every colour out of the positive shown, whatever cast the film has: a black and white film that comes out sepia or slightly coloured comes out grey. The saved TIFF is a single 16-bit grey channel, a third of the size of a colour one.

Closes #30

How it works

  • After the levels and Warmth and Tint, the three channels are mixed into one grey (0.299 R + 0.587 G + 0.114 B) and that grey replaces all three. It is what Saturation at -100 already did; the checkbox holds saturation there and the slider is greyed out. Capture One's own black and white negative styles do the same: Saturation -100.
  • Warmth and Tint still work, before the mix, as a coloured filter on the lens would: they change how light each colour comes out in grey.
  • The positive knows it is grey, and its TIFF is written with one sample per pixel (BlackIsZero) instead of RGB.
  • rollscan convert gets --black-and-white.

Tested

  • cargo test: 297 passed.
  • A Kodak Portra 160 RAF from a Fujifilm X-T5 (7752 x 5184), in the Convert tab in Chromium: once ticked, every pixel of the preview has the same red, green and blue; Saturation greys out, and comes back when unticked; no page errors.
  • rollscan convert --black-and-white on the same file: a 77 MB TIFF (230 MB in colour) that Pillow opens as 16-bit grey.

Not tested

  • A real black and white negative, sepia or otherwise.
  • Saving through the app (it runs the same conversion as convert).
  • Opening the grey TIFF in an editor (Lightroom, darktable, Capture One).
  • The scanner: nothing here touches the camera or the Arduino.

Changes in behaviour

  • A new checkbox in Adjustments; nothing changes for a negative that does not use it.
**Sits on top of #29: merge #29 first.** A **Black and white** checkbox at the top of the Convert tab's adjustments takes every colour out of the positive shown, whatever cast the film has: a black and white film that comes out sepia or slightly coloured comes out grey. The saved TIFF is a single 16-bit grey channel, a third of the size of a colour one. Closes #30 ## How it works - After the levels and Warmth and Tint, the three channels are mixed into one grey (`0.299 R + 0.587 G + 0.114 B`) and that grey replaces all three. It is what Saturation at -100 already did; the checkbox holds saturation there and the slider is greyed out. Capture One's own black and white negative styles do the same: Saturation -100. - Warmth and Tint still work, before the mix, as a coloured filter on the lens would: they change how light each colour comes out in grey. - The positive knows it is grey, and its TIFF is written with one sample per pixel (BlackIsZero) instead of RGB. - `rollscan convert` gets `--black-and-white`. ## Tested - `cargo test`: 297 passed. - A Kodak Portra 160 RAF from a Fujifilm X-T5 (7752 x 5184), in the Convert tab in Chromium: once ticked, every pixel of the preview has the same red, green and blue; Saturation greys out, and comes back when unticked; no page errors. - `rollscan convert --black-and-white` on the same file: a 77 MB TIFF (230 MB in colour) that Pillow opens as 16-bit grey. ## Not tested - A real black and white negative, sepia or otherwise. - Saving through the app (it runs the same conversion as `convert`). - Opening the grey TIFF in an editor (Lightroom, darktable, Capture One). - The scanner: nothing here touches the camera or the Arduino. ## Changes in behaviour - A new checkbox in Adjustments; nothing changes for a negative that does not use it.
- The levels are counted row by row on every core and the counts added up; the pixels
  are made row by row the same way. The results are the same to the byte.
- The TIFF is written to the file as it is made, through a small buffer, instead of
  being built whole in memory first (229 MB for a 40-megapixel frame).
- On a Fujifilm X-T5 RAF: a preview in the app 174 -> 46 ms, a full conversion
  3.1 -> 1.2 s.
- A new preview is asked for as soon as the last one is shown, with the values set by
  then, one at a time, instead of 150 ms after the slider stops.
eliott merged commit e0f309b40b into main 2026-11-20 00:03:06 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
RollNote/rollscan!32
No description provided.