### Inversion of Film Negative Discussion of technique

Posted:

**2017-10-19T10:39:32-07:00**I have a good understanding of conventional photographic processes, can print color neg, B&W with reasonable skill etc, some limited math (should have paid attention more in class), and some basic understanding of the digital scanning processes. I am attempting to use imagemagick with some additional scripts to provide a better software solution for scanning film (both B&W and color).

I have read a few papers on the topic and my limited knowledge tell me that simply using a function to 'Invert' like negate on its own will not work with a film negative.

Some scanner software have film profiles, which I suspect, is a function using the film base as 'black point' and characteristic curve of the film to the inversion.

I am currently using a script that uses the following algorithm (which I got from a script):

1. Determine the RGB values of the film base, and the RGB of brightest area of series of shots (in similar lighting) from a linear scan of the negative

using -format fx: minima.r maxima.r

2. calculate the following values

a. calculate the value to subtract from each channel using the max and min from red channel

$subtract= (minima.r/maxima.r)^(1/$desired_gamma)*QuantumRange*0.95 [$desired_gamma = 2.15)

b. calculate the extra gamma to be applied to green and blue channel using the following

$extra_gamma_g = log(maxima.g)/minima.g)/log(maxima.r/minima.r)

$extra_gamma_b = log(maxima.b)/minima.b)/log(maxima.r/minima.r)

3. apply those values to image:

convert infile -set colorspace RGB \

-channel R -fx "$min_r/u" \

-channel G -fx "$min_g/u" -gamma $extra_gamma_g \

-channel B -fx "$min_b/u" -gamma $$extra_gamma_b \

+channel -gamma $desired_gamma -evaluate Subtract $subtract \

outfile

This seems to work pretty well as a starting point, and I have my head around most of the math,

So I am opening this up for discussion on:

a. how this compares with other approaches

b. how I might improve it

I have read a few papers on the topic and my limited knowledge tell me that simply using a function to 'Invert' like negate on its own will not work with a film negative.

Some scanner software have film profiles, which I suspect, is a function using the film base as 'black point' and characteristic curve of the film to the inversion.

I am currently using a script that uses the following algorithm (which I got from a script):

1. Determine the RGB values of the film base, and the RGB of brightest area of series of shots (in similar lighting) from a linear scan of the negative

using -format fx: minima.r maxima.r

2. calculate the following values

a. calculate the value to subtract from each channel using the max and min from red channel

$subtract= (minima.r/maxima.r)^(1/$desired_gamma)*QuantumRange*0.95 [$desired_gamma = 2.15)

b. calculate the extra gamma to be applied to green and blue channel using the following

$extra_gamma_g = log(maxima.g)/minima.g)/log(maxima.r/minima.r)

$extra_gamma_b = log(maxima.b)/minima.b)/log(maxima.r/minima.r)

3. apply those values to image:

convert infile -set colorspace RGB \

-channel R -fx "$min_r/u" \

-channel G -fx "$min_g/u" -gamma $extra_gamma_g \

-channel B -fx "$min_b/u" -gamma $$extra_gamma_b \

+channel -gamma $desired_gamma -evaluate Subtract $subtract \

outfile

This seems to work pretty well as a starting point, and I have my head around most of the math,

So I am opening this up for discussion on:

a. how this compares with other approaches

b. how I might improve it