as part of the effort for the Output Transform VWG, I wanted here to detail the process to convert images using the ctl reference code. This post is a transcript of the conservation held on rocketchat with @sdyer, @Alexander_Forsythe and @nick.
There is a certain need for accuracy when reviewing images processed with the ACES Output Transforms, that it is not available currently in OCIO V1. Hence the need to process the images using CTL.
You may start by installing the Ubuntu 20.04 LTS from the windows store for free. You do need an hotmail account though to download and install it.
Once you’re done, you may open a terminal and follow these steps :
# Update apt and install dependencies sudo apt update sudo apt-get install cmake libilmbase-dev libopenexr-dev libtiff-dev build-essential -y # Build and install aces_container cd ~ git clone https://github.com/ampas/aces_container.git && cd aces_container mkdir build && cd build cmake .. && make && sudo make install # Build and install ctl cd ~ git clone https://github.com/ampas/CTL.git cd CTL git fetch origin pull/73/head:pr-73 git checkout pr-73 mkdir build && cd build cmake .. && make && sudo make install # Get ACES CTL files and add lib directory to CTL_MODULE_PATH environment variable cd ~ git clone https://github.com/ampas/aces-dev.git export CTL_MODULE_PATH=~/aces-dev/transforms/ctl/lib
Please note that this script from Alex Forsythe is a temporary fix. And also that the last command
needs to be run every time you open a new terminal. The command is only active in the terminal where it is activated. If you wanted it to persist, you’d need to put it in your shell startup (it’s just an env variable that shows where it should look for ctl modules, import files, etc). Or you could also add it to your bashrc file.
Now the command to convert AP0 exr files to Output - Rec.709 (ACES) tiff is this :
ctlrender -ctl /path/to/ctl/rrt/RRT.ctl -ctl /path/to/ctl/odt/rec709/ODT.Academy.Rec709_100nits_dim.ctl /path/inputImage.exr /outputpath/outputImage.tiff
You’d need to use your actual local path to the CTL. Same thing for the Rec.709 (ODT).
The command may look like this :
ctlrender -ctl /home/yourname/aces-dev/transforms/ctl/rrt/RRT.ctl -ctl /home/yourname/aces-dev/transforms/ctl/odt/rec709/ODT.Academy.Rec709_100nits_dim.ctl /home/yourname/aces-dev/images/RenderPass_Beauty_All_Beauty_1_00001.exr /mnt/c/Users/Home/Documents/ctl/test3.tiff
This command expects AP0 exr files. The RRT expects linear AP0 (aka ACES). The flie format could be something else technically but will almost always be exr in practice.
You can stack up as many CTLs as you need. So you could have IDT -> LMT -> RRT -> ODT, each as a CTL, in which case the appropriate input would be e.g. LogC. Or if your EXR was ACEScg, the first CTL would be the ACEScg to ACES CSC.
A few extra notes :
- You sometimes need to add
-param1 aIn 1or you get an error saying aIn has no default value if your input image is RGB only.
- You can also add
-format tiff8to get an 8 bits tiff file, it would only affect the output format.
- You can also try adding a -v flag and see how far the verbosity report gets.
- If you think there is a permission issue, you may try this command on the output folder :
chmod ugo+rwx images/
ctlrender -helpis also a commande that can be useful if you’re having issues.
Hopefully, processing images in ctl is now a bit easier for window users,