This is the next version of negfix script, which can be used to automate the process of negative film
scanning. The script works with traditional B&W negatives as well as with color C-41 negatives (in that
case the orange mask is automatically removed). The script is using log curve, so the outcome resembles
the traditional print.

Negfix8 script allows you to scan each film frame using the same settings, which speeds up the scanning
process. The negatives are scanned as positives. After batch scanning of negatives and turning them into
the positives, each frame can be further fine-tuned one by one, as you like. To do that you can use the software
which is much better suited to the task than traditional scanning software. The perfect choice is Lightroom,
Photoshop, Gimp, and many others.

Since a linear scan already contains all information that can be extracted by the scanner, the film can
be scanned once and then processed in many ways, as you need.

The input data to this script is TIFF file, with linear color channels (gamma=1.0)
and with 16-bit color depth per channel.
In SilverFast software it means you have to use 48bit HDR (color)
or 16bit HDR (b&w) mode.

No sharpening must be performed on that file, you need to turn off any automatic enhancements, too.

Scanned frame must not contain any holder fragments (it means no pixels with value of 0) or script
will fail.

The scanned frame should, however, contains orange mask pixels (the area between frames,
at least 20 pixels width).

Negfix8 is using ImageMagick free software, which is available for Linux, Mac and Windows operating systems.
You need to install Q16 version, not Q8.

This script is working in command line window. There is no GUI, which is not necessary.

The output generated by this script with -cs option is very close to the final image, for some images you may want to
modify the brightness, contrast or white balance.


  1. If the ImageMagick software is not installed yet, download and install it (see "Binary Releases" option on page).
  2. Copy the script file (negfix8 (Linux/Mac) or negfix8.cmd (Win)) to the directory which is listed on $PATH (%PATH%) environment variable, for instance to the /usr/local/bin (Linux) or C:\Windows directory.
  3. Windows XP users can install CmdHere.exe add-on (, which allows you to open the command window in the directory selected in the Windows Explorer. Windows Vista and 7 users do not need it. It is already included in the system, you just need to right-click the directory with SHIFT key pressed.


To start using the script, you need to open the command line window in the directory where tiff files are saved.
You can use one of the method described above or you can use cd dir_name command

To display short help, just run the script without any arguments.

The simplest way to use the script is to run it with the name of one tiff file containing the scanned frame.

    negfix8 scan1.tif

(this process the scan from scan1.tif file, creates the positive image, and then saves it in the P_scan1.tif file)

You can also choose different output file name and extension:

    negfix8 scan1.tif scan_1.jpg

(this process the scan from scan1.tif file, creates the positive image, and then saves it in the scan_1.jpg file.)

There are two methods for processing multiple files.

Method 1: you can process many files in one command, using the loop:

        FOR %i IN (*.tif) DO negfix8 %i
        for i in *.tif; do negfix8 "$i"; done

Method 2: you can also use meta characters or put many file names, for instance (from version 1.3 of the script):

        negfix8 *.tif
        negfix8 frame1.tif frame8.tif frame11.tif

The difference beetween method 1 and 2 is that in method 1 the files are processed separately, in method 2 the
files are converted using common average frame profile. This means that for the best result all files must come
from the same roll. Do not mix overexposed frames and underexposed ones, do not mix normal frames and
frames with strong light sources. Convert such frames in separate commands.

Negfix8 supports following options:

-cs   -- performs contrast stretch operation. It means that values in all color channels are spanning the most
         of 0 - 255 values. If you do not use this option, the scan may look flat, but do not worry, you can adjust
         the curves in the Photoshop/Lightroom/Gimp later on.

-s X  -- separates one color channel. Useful when scanning B&W negatives in color mode. Sometimes the scanner
         yields better quality in green or blue channel in color mode comparing to scanning in B&W mode.
         You can choose as an option the channel you want to separate to the output file.

-r X  -- sometimes the scanner produces better quality output when it is working in high resolution mode, but you do not
         need so huge positives. The -r options allows you to X-fold reduction (2-, 3- or 4-fold) of the input image by averaging
         adjacent pixels. For example, 3-fold reduction means that the output pixel is created from the average of 9 source
         pixels (in 3x3 square). It can be used to reduce digital noise of the scanner (it is similar to multi-sampling feature
         of some scanners).

-g X  -- you can specify the gamma of the image created.

-m    -- creates the mirror image (if you put the negative up side down on the scanner glass).

This script allows you to "copy" color settings from one frame to another. This way you can get consistent colors between shots.
I call those settings as profiles. Profiles are small text files which contains numerical data. To create color profile for selected
frame issue the following command:

    negfix8 -c profile_name scan1.tif

it creates the profile using name provided. The output image is not created. Previous profile of the same name will be
overwritted without warning. Next, you can use the profile on other files, for example:

    negfix8 -u profile_name -cs -r 2 scan2.tif scan2.jpg

If you are curious where profiles are saved, you can use the name of nonexistent profile:

    negfix8 -u alamakota

Negfix8 works very well for frames without strong light sources. If the frame do have such light sources (Sun, lamps,
candles, reflections, etc), the output will be flat, even with -cs option. You can circumvent this, using profile from
another frame on the same roll:

    negfix8 -c tmp1 scan_no_light_sources.tif
     negfix8 -u tmp1 -cs scan_with_light_sources.tif

There are two versions of the script:
 * negfix8 (tested on Linux with ImageMagick-6.5.7-8-Q16 and 6.8.0-8-Q16, should work on Mac OS)
 * negfix8.cmd (tested on Windows 7 with ImageMagick-6.8.5-Q16, should work on Vista and Windows XP/8)


The following is fixed in negifx8.1 version:
The TIFF file format can inclue multiple optional metadata, depending on the software used to create the file. ImageMagick is supposed to ignore such extra fields, however, depending on the IM version, you can get the following error message:

convert: xxxx.tif: unknown field with tag 59932 (0xea1c) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/703

The solution is to purge such extra fields with simple command:

convert xxxx.tif yyyy.tiff

This command invokes the ImageMagic's convert tool and does nothing but copy image from xxxx.tif file to the yyyy.tif file. The error message will be displayed, but it can be ignored in this case. The yyyy.tif file can be then processed with the negfix8 script. 

This is the bug in the ImageMagick software.