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.
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
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)]
All images — process any RAW/NEF/CR2 file in working directory, using GNU Parallel.
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.
Switch on debugging mode, showing everything that's going on.
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.
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
Display help text
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.
Output directory — default is current working directory. Example: -o results
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
Resize image — pixel width for larger side, preserving aspect ratio. Example: -r 3000
Verbous mode — show some more information under way.
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.
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.
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
--orientation
. --rating
that requires a minimum star rating. --resize
, --desaturate
and so on.These features go into the current major version 1:
~/.negativesrc
or ~/linear-tiff.conf
or even an INI, YAML or JSON? Head over to issue #7.The -r option will be renamed to -w, as -r is more natural for the upcoming Rating filter, and so is -w for width.
The -f option will be renamed to -m, as the actually performed image action is mirroring horizontally or vertically. The option values flip, flop and flipflop will then become something like V, H or VH.
New batch mode trigger: New sub-command all
will replace the current -a
flag, like so: linear-tiff batch <options>
.
Orientation: This option will be enabled per default.
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.
$ git clone https://github.com/tomkyle/negatives-linear-tiff.git