tomkyle / negatives-linear-tiff

Converts RAW/NEF/CR2 files into linear TIFF files, using GNU Parallel for maximum speed. Other features: B/W grayscaling, TIF resizing and ZIP compression.
https://tomkyle.github.io/negatives-linear-tiff
Other
7 stars 1 forks source link

New feature: take account of cropping in Camera Raw et al. #8

Open tomkyle opened 7 years ago

tomkyle commented 7 years ago

After shooting your negatives it may be useful to crop the RAW files first to get rid of unneeded parts of the negative holder. _lineartiff should consider this crop data and crop the output image accordingly. Example workflow:

  1. User shoot negative, crop RAW in Camera Raw. Crop data is now in XMP sidecar file.
  2. Run _lineartiff:
    • _lineartiff runs dcraw. The resulting TIFF file should be (surely is?) uncropped.
    • _lineartiff runs mogrify and crops the output according to the crop data in XMP file.

The crop data are stored like this: http://www.exiv2.org/tags-xmp-crs.html and can be extracted.

I am not sure about how Lightroom and other RAW converters handle this.

tomkyle commented 7 years ago

The crop information can be extracted with exiftool . The output values are percentage. While ImageMagick does accept width and height as percentage, the crop offsets seem to have to be in pixels. This article describes how: http://infoheap.com/crop-image-using-imagemagick-convert/

Here's a small script that prints a crop summary for development work: https://github.com/tomkyle/show-crop

tomkyle commented 7 years ago

As of release 1.1.2 and 1.1.3, the output file is now cropped when the input file's meta data have crop information stored, even in an XMP sidecar file.

Currently, crops with angles other than 0 are not supported. The reason, I simply did not experiment with it. Has someone experience on this?