Easily generate DCP profiles using DCamProf and this Bash script

generateDCP

I wrote this Bash script to easily generate DCP profiles using Anders Torger’s DCamProf. It would be nice to hear if you find it useful.

Requirements

Make sure you have DCamProf and ArgyllCMS installed. The script requires the argyll-scanin command. On some systems this command is called just scanin. If that is the case for you, just delete the “argyll-” part from this script’s code.

Steps

  1. Follow the code link, click on “raw”, copypasta the code into a text file, save it for example as ~/generateDCP and then make it executable using chmod +x ~/generateDCP
  2. Generate the required daylight.tif and/or tungsten.tif files using RawTherapee and save them to the same folder which contains the dcamprof executable - see How to create DCP color profiles - RawPedia
  3. Go into that folder and run the script, ~/generateDCP -h
    The defaults are best, so you just need to set the camera name, e.g.
    ~/generateDCP -c "Nikon D810"

Code

Pizza: 12TvLCkW95pW9LfLjna4HnKhsFDdrjyYzE

1 Like

Cool!

A few ideas:

Check if Argyll is installed

command -v argyll-scanin >/dev/null 2>&1 || { echo >&2 "It seems Argyll is not installed. Please install."; exit 1;}

Instead of having to move the files to where the DCamProf executable is, ask for the path.

printf "Please enter the path to the DCamProf executable"
while read -e -p ": " CHOICE; do
    case "$CHOICE" in
            "") printf "Please enter the path to the DCamProf executable: " ;;
             *) DCAMPROFPATH="$CHOICE"; break ;;
    esac
done

Instead of asking for the camera name, read it from the file

camera="$(exiftool -s -s -s -model daylight.tif)"

Hey

  1. I will implement checking for argyll-foo or foo without the argyll- prefix.
  2. I want the script to run fast with minimal user input, so I won’t add asking for a path. I’ve made many DCPs and it’s fastest for me to just save the TIFFs to the dcamprof folder, overwriting the old ones. dcamprof as far as I know is not in any package manager yet so I don’t worry about the problem of putting images into /usr/bin, as dcamprof will most likely be in $HOME/programs/dcamprof or some place similar.
  3. The camera name contained in the image metadata (Exif, makernotes, etc) is not the same as the camera name used to identify the DCP file, so I need that to be manually editable. I won’t change this either.

Script updated. Now it tries to use scanin if argyll-scanin doesn’t work, and the diagnostic images show more useful info.

1 Like

Thank you. It works just fine.

Script updated and moved to GitHub. Now it supports the -g gamut compression available in DCamProf 1.0.4. Also supports automatically extracting the camera model from the TIFF files if they contain that info (“Save reference image for profiling” from RawTherapee does not include that info so you still need to use -c).

I have an x-rite passport and so far have been using the software that comes with it (though it is freely available). Do you think the process/script above might have benefits beyond that of x-rite’s, for example a better quality profile? My .dcp files are small - just 2k - I think this is something to do with not having a tone curve included. But I don’t know whether that matters.

That’s quite likely. It’s far more flexible, it’s FLOSS, shows you the calculated values, you can plot a graph, you can compress the gamut or add curves, etc.

Script updated to 2016-12-31, corrects small bug.

@RawConvert I have an XRite passeport bought 4 years ago and can confirm that the profile generated by dcamprof gives more accurate colors for my Pentax K-1, especially in highlights. I don’t know where the embedded tone curve comes from though.

Thanks @Hombre, I’ll add this process and dcamprof to my list of things to get into when time allows.

Updated script. Added -l parameter to specify layout file, and -r to specify reference file. Now you can easily create a dual-illuminant DCP from an IT-8 target:
~/scripts/generateDCP -c "NIKON D750" -l it8 -r /tmp/R151101.txt

1 Like