negatives/linear-tiff

Build Status

Converts RAW/NEF/CR2 files into linear 16bit-TIFF files.

What happens inside? LibRaw’s dcraw_emu creates a linear 16bit TIFF file from your photographed negative raw file. ImageMagick’s mogrify then does the color-profiling, B/W grayscaling, mirroring, resizing, cropping, orientation, and ZIP compression. GNU Parallel uses all CPU cores to speed up the whole thing.

Homebrew Installation (MacOS)

The linear-tiff bash script can be installed by a Homebrew formula, which itself is part of the tomkyle/homebrew-negatives tap.

# Variant 1:
# Install tap first, formula second:
$ brew tap tomkyle/negatives
$ brew install linear-tiff

As “tapping” first is not neccessarily needed, you can install the formula directly:

# Variant 2
$ brew install tomkyle/negatives/linear-tiff

Usage

Open your terminal application and go to your images directory. linear-tiff will work in the current working directory. Run linear-tiff --help or -h to display help text. See Options and Examples.

$ linear-tiff [options] [-a | file(s)]

Options

-a, –all

All images — process any RAW/NEF/CR2 file in working directory, using GNU Parallel.

-c, –crop

Crop output image, if input file’s meta data carry crop information. Useful when cropping film holder parts away with your Raw converter—The output image will then be cropped as well, even if the crop info is stored a XMP sidecar file. Currently, no crop angles are supported.

–debug

Switch on debugging mode, showing everything that’s going on.

-d, –desaturate

Desaturate colors — recommended for B/W negatives. dcraw’s TIFF output is converted to 16-bit grayscale, with a linear gamma 1.0 ICC profile applied (Gray-elle-V4-g10.icc). Grayscaling saves up to 60% in file size.

-m, –mirror value

Mirror the image vertically and/or horizontally. Possible values are horizontal horizontal, vertical or even both (guess what). Short values are h and v. Examples: -m horizontal, -m v, -m both

-h, –help

Display help text

–orientation

Enable image rotation. Rotate your RAW files before running linear-tiff with your Raw Converter. “Orientation” metadata given in XMP file overrides any according RAW file entry.

-o, –output path

Output directory — default is current working directory. Example: -o results

–rating stars

Omit images that do not reach this star rating threshold. At least in Adobe Camera Raw, rejected images have -1 stars. To omit these (i.e. process only non-rejected files), pass rating parameter like so: --rating 0. To process only starred images, set to --rating 1

-w, –width pixel

Resize image — pixel width for larger side, preserving aspect ratio. Example: -r 3000

-v, –verbous

Verbous mode — show some more information under way.

Deprecated Options

-f, –flipflop (deprecated)

Mirror the image vertically and/or horizontally. Possible values are flop horizontal, flip vertical or even flipflop (guess what). Example: -f flop. This option will be replaced by -m, –mirror as of version 2.

-r, –resize pixel (deprecated)

Resize image — pixel width for larger side, preserving aspect ratio. Example: -r 3000. This option will be replaced by -w, –width as of version 2.

Examples

Convert all images or list of images in current working directory using defaults:

# All images:
$ linear-tiff -a 
$ linear-tiff --all

# List of images:
$ linear-tiff DSC0001.NEF DSC0002.NEF DSC0003.NEF

Desaturate B/W negatives:

# These are equal:
$ linear-tiff -d DSC0001.CR2 DSC0002.CR2
$ linear-tiff --desaturate DSC0001.CR2 DSC0002.CR2

# And those as well:
$ linear-tiff -ad
$ linear-tiff -a --desaturate
$ linear-tiff --all -d
$ linear-tiff --all --desaturate

Resize images:

# These are equal:
$ linear-tiff -r 2048 DSC0001.CR2 DSC0002.CR2
$ linear-tiff -a --resize 2048

Fullstack Conversion:

# These are equal:
$ linear-tiff -advc -r 2048 -f flop -o fullstack --rating 0
$ linear-tiff --all --rating 0 --desaturate --crop --resize 2048 --mirror horizontal --output fullstack --verbous

Changelog

New Features

v.1.1.6

v1.1.4

v1.1.2

v1.1.0

Upcoming Features

These features go into the current major version 1:

Roadmap to version 2

Issues and FAQ

To see the full list, head over to the issues page.

Cropping the output image: The output cropping is in fact a “shaving”, when image size displayed in the Raw Converter is different than both the sensor size and draw’s output image size. linear_tiff creates the shaving information by the pixel dimensions of the embedded JPG thumbnail and dcraw’s output file. Currently Nikon NEF and Canon CR2 are supported. See issue#14 for what’s going on.

linear-tiff does not find my Raw photos in batch mode.
Currently, linear-tiff uses a regex to locate RAW files by these extensions: NEF (Nikon), CR2 (Canon), and RAW (Contax, Kodak, Leica, Panasonic). Leave a comment on issue#2 to “order” your favourite file extension. I’ll happily lengthen the regex to your needs :smiley:

I get a error message “mogrify: delegate library support not built-in”
ImageMagick must be compiled with litte-cms2 support. See issue#1 for details.

Development and Contribution

$ git clone https://github.com/tomkyle/negatives-linear-tiff.git