├── .coveragerc ├── .github └── workflows │ ├── configuration-artifacts.yml │ ├── continuous-integration-quality-unit-tests.yml │ └── continuous-integration-static-type-checking.yml ├── .gitignore ├── .gitmodules ├── .pre-commit-config.yaml ├── .readthedocs.yaml ├── Dockerfile ├── LICENSE ├── README.rst ├── docs ├── Makefile ├── _static │ └── ACES_Conversion_Graph.svg ├── _templates │ └── class.rst ├── conf.py ├── index.rst ├── installation.rst ├── make.bat ├── opencolorio_config_aces.clf.rst ├── opencolorio_config_aces.config.rst ├── opencolorio_config_aces.rst ├── opencolorio_config_aces.utilities.rst ├── process.rst ├── reference.rst ├── requirements.txt ├── usage.rst └── user-guide.rst ├── opencolorio_config_aces ├── __init__.py ├── clf │ ├── __init__.py │ ├── discover │ │ ├── __init__.py │ │ └── classify.py │ └── transforms │ │ ├── __init__.py │ │ ├── apple │ │ ├── __init__.py │ │ ├── generate.py │ │ └── input │ │ │ ├── Apple.Input.Apple_Log-Curve.clf │ │ │ └── Apple.Input.Apple_Log_to_ACES2065-1.clf │ │ ├── arri │ │ ├── __init__.py │ │ ├── generate.py │ │ └── input │ │ │ ├── ARRI.Input.ARRI_LogC3_Curve_EI800.clf │ │ │ ├── ARRI.Input.ARRI_LogC3_EI800_to_ACES2065-1.clf │ │ │ ├── ARRI.Input.ARRI_LogC4_Curve.clf │ │ │ ├── ARRI.Input.ARRI_LogC4_to_ACES2065-1.clf │ │ │ ├── ARRI.Input.Linear_ARRI_Wide_Gamut_3_to_ACES2065-1.clf │ │ │ └── ARRI.Input.Linear_ARRI_Wide_Gamut_4_to_ACES2065-1.clf │ │ ├── blackmagic │ │ ├── __init__.py │ │ ├── generate.py │ │ └── input │ │ │ ├── BlackmagicDesign.Input.BMDFilm_Gen5_Log-Curve.clf │ │ │ ├── BlackmagicDesign.Input.BMDFilm_WideGamut_Gen5_to_ACES2065-1.clf │ │ │ ├── BlackmagicDesign.Input.DaVinci_Intermediate_Log-Curve.clf │ │ │ ├── BlackmagicDesign.Input.DaVinci_Intermediate_WideGamut_to_ACES2065-1.clf │ │ │ ├── BlackmagicDesign.Input.Linear_BMD_WideGamut_Gen5_to_ACES2065-1.clf │ │ │ └── BlackmagicDesign.Input.Linear_DaVinci_WideGamut_to_ACES2065-1.clf │ │ ├── canon │ │ ├── __init__.py │ │ ├── generate.py │ │ └── input │ │ │ ├── Canon.Input.CLog2-Curve.clf │ │ │ ├── Canon.Input.CLog3-Curve.clf │ │ │ ├── Canon.Input.CanonLog2_CinemaGamut-D55_to_ACES2065-1.clf │ │ │ ├── Canon.Input.CanonLog3_CinemaGamut-D55_to_ACES2065-1.clf │ │ │ └── Canon.Input.Linear-CinemaGamut-D55_to_ACES2065-1.clf │ │ ├── itu │ │ ├── __init__.py │ │ ├── generate.py │ │ └── utility │ │ │ ├── ITU.Utility.AP0_to_Camera_Rec709.clf │ │ │ └── ITU.Utility.Rec709-Curve.clf │ │ ├── ocio │ │ ├── __init__.py │ │ ├── generate.py │ │ └── utility │ │ │ ├── OCIO.Utility.AP0_to_CIE_XYZ-D65-Scene-referred.clf │ │ │ ├── OCIO.Utility.AP0_to_Gamma1.8_Encoded_Rec709.clf │ │ │ ├── OCIO.Utility.AP0_to_Gamma2.2_Encoded_AP1.clf │ │ │ ├── OCIO.Utility.AP0_to_Gamma2.2_Encoded_AdobeRGB.clf │ │ │ ├── OCIO.Utility.AP0_to_Gamma2.2_Encoded_Rec709.clf │ │ │ ├── OCIO.Utility.AP0_to_Gamma2.4_Encoded_Rec709.clf │ │ │ ├── OCIO.Utility.AP0_to_Linear_AdobeRGB.clf │ │ │ ├── OCIO.Utility.AP0_to_Linear_P3-D65.clf │ │ │ ├── OCIO.Utility.AP0_to_Linear_Rec2020.clf │ │ │ ├── OCIO.Utility.AP0_to_Linear_Rec709.clf │ │ │ ├── OCIO.Utility.AP0_to_sRGB-Encoded-Rec709.clf │ │ │ ├── OCIO.Utility.AP0_to_sRGB_Encoded_AP1.clf │ │ │ ├── OCIO.Utility.AP0_to_sRGB_Encoded_P3-D65.clf │ │ │ ├── OCIO.Utility.Rec1886-Curve.clf │ │ │ ├── OCIO.Utility.ST2084-Curve.clf │ │ │ └── OCIO.Utility.sRGB-Curve.clf │ │ ├── panasonic │ │ ├── __init__.py │ │ ├── generate.py │ │ └── input │ │ │ ├── Panasonic.Input.Linear_VGamut_to_ACES2065-1.clf │ │ │ ├── Panasonic.Input.VLog-Curve.clf │ │ │ └── Panasonic.Input.VLog_VGamut_to_ACES2065-1.clf │ │ ├── red │ │ ├── __init__.py │ │ ├── generate.py │ │ └── input │ │ │ ├── RED.Input.Linear_REDWideGamutRGB_to_ACES2065-1.clf │ │ │ ├── RED.Input.Log3G10-Curve.clf │ │ │ └── RED.Input.Log3G10_REDWideGamutRGB_to_ACES2065-1.clf │ │ ├── sony │ │ ├── __init__.py │ │ ├── generate.py │ │ └── input │ │ │ ├── Sony.Input.Linear_SGamut3Cine_to_ACES2065-1.clf │ │ │ ├── Sony.Input.Linear_SGamut3_to_ACES2065-1.clf │ │ │ ├── Sony.Input.Linear_SGamut_to_ACES2065-1.clf │ │ │ ├── Sony.Input.Linear_Venice_SGamut3Cine_to_ACES2065-1.clf │ │ │ ├── Sony.Input.Linear_Venice_SGamut3_to_ACES2065-1.clf │ │ │ ├── Sony.Input.SLog2-Curve.clf │ │ │ ├── Sony.Input.SLog2_SGamut_to_ACES2065-1.clf │ │ │ ├── Sony.Input.SLog3-Curve.clf │ │ │ ├── Sony.Input.SLog3_SGamut3Cine_to_ACES2065-1.clf │ │ │ ├── Sony.Input.SLog3_SGamut3_to_ACES2065-1.clf │ │ │ ├── Sony.Input.SLog3_Venice_SGamut3Cine_to_ACES2065-1.clf │ │ │ └── Sony.Input.SLog3_Venice_SGamut3_to_ACES2065-1.clf │ │ └── utilities.py ├── config │ ├── __init__.py │ ├── cg │ │ ├── __init__.py │ │ └── generate │ │ │ ├── __init__.py │ │ │ ├── config.py │ │ │ ├── resources │ │ │ └── OpenColorIO-Config-ACES CG and Studio Transforms - v3 - CG Config - Mapping.csv │ │ │ └── tests │ │ │ ├── __init__.py │ │ │ └── test_resources.py │ ├── generation │ │ ├── __init__.py │ │ ├── beautifiers.py │ │ ├── common.py │ │ ├── configuration.py │ │ ├── factories.py │ │ └── version.py │ ├── reference │ │ ├── __init__.py │ │ ├── discover │ │ │ ├── __init__.py │ │ │ ├── classify.py │ │ │ ├── graph.py │ │ │ └── resources │ │ │ │ └── ACES_AMF_Components.json │ │ └── generate │ │ │ ├── __init__.py │ │ │ ├── analytical.py │ │ │ ├── config.py │ │ │ ├── resources │ │ │ └── OpenColorIO-Config-ACES Reference Transforms - v3 - Reference Config - Mapping.csv │ │ │ └── tests │ │ │ ├── __init__.py │ │ │ └── test_resources.py │ └── studio │ │ ├── __init__.py │ │ └── generate │ │ ├── __init__.py │ │ ├── config.py │ │ ├── resources │ │ └── OpenColorIO-Config-ACES CG and Studio Transforms - v3 - Studio Config - Mapping.csv │ │ └── tests │ │ ├── __init__.py │ │ └── test_resources.py └── utilities │ ├── __init__.py │ └── common.py ├── pyproject.toml ├── requirements.txt ├── tasks.py └── utilities ├── resources └── texlive.profile └── tools └── testclf ├── README.rst ├── requirements.txt └── testclf.py /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | source = opencolorio_config_aces 3 | [report] 4 | exclude_lines = 5 | pragma: no cover 6 | if __name__ == .__main__.: 7 | pass 8 | -------------------------------------------------------------------------------- /.github/workflows/configuration-artifacts.yml: -------------------------------------------------------------------------------- 1 | name: Configuration Artifacts 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | configuration-artifacts: 7 | name: ${{ matrix.os }} - Python ${{ matrix.python-version }} 8 | strategy: 9 | matrix: 10 | os: [ubuntu-latest] 11 | python-version: [3.13] 12 | fail-fast: false 13 | runs-on: ${{ matrix.os }} 14 | steps: 15 | - uses: actions/checkout@v4 16 | with: 17 | submodules: recursive 18 | - name: Environment Variables 19 | run: | 20 | echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV 21 | echo "CI_PACKAGE=opencolorio_config_aces" >> $GITHUB_ENV 22 | echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV 23 | shell: bash 24 | - name: Set up Python ${{ matrix.python-version }} 25 | uses: actions/setup-python@v4 26 | with: 27 | python-version: ${{ matrix.python-version }} 28 | - name: Install Dependencies 29 | run: | 30 | sudo apt-get --yes install graphviz graphviz-dev 31 | - name: Install uv 32 | run: | 33 | pip install uv 34 | shell: bash 35 | - name: Install Package Dependencies 36 | run: | 37 | uv sync --all-extras --no-dev 38 | uv run python -c "import imageio;imageio.plugins.freeimage.download()" 39 | shell: bash 40 | - name: ACES - Conversion Graph 41 | run: | 42 | uv run invoke build-aces-conversion-graph 43 | shell: bash 44 | - uses: actions/upload-artifact@v4 45 | with: 46 | name: aces-conversion-graph 47 | path: | 48 | build/aces/graph/ 49 | - name: Generation - Config - Common Tests 50 | run: | 51 | uv run invoke build-config-common-tests 52 | shell: bash 53 | - uses: actions/upload-artifact@v4 54 | with: 55 | name: config-common-tests 56 | path: | 57 | build/config/common/tests/ 58 | - name: Generation - Config - ACES Reference (Analytical) 59 | run: | 60 | uv run invoke build-config-reference-analytical 61 | shell: bash 62 | - uses: actions/upload-artifact@v4 63 | with: 64 | name: config-reference-analytical 65 | path: | 66 | build/config/aces/analytical/ 67 | - name: Generation - Config - ACES Reference 68 | run: | 69 | uv run invoke build-config-reference 70 | shell: bash 71 | - uses: actions/upload-artifact@v4 72 | with: 73 | name: config-reference 74 | path: | 75 | build/config/aces/reference/ 76 | - name: Generation - Config - ACES CG 77 | run: | 78 | uv run invoke build-config-cg 79 | shell: bash 80 | - uses: actions/upload-artifact@v4 81 | with: 82 | name: config-cg 83 | path: | 84 | build/config/aces/cg/ 85 | - name: Generation - Config - ACES Studio 86 | run: | 87 | uv run invoke build-config-studio 88 | shell: bash 89 | - uses: actions/upload-artifact@v4 90 | with: 91 | name: config-studio 92 | path: | 93 | build/config/aces/studio/ 94 | -------------------------------------------------------------------------------- /.github/workflows/continuous-integration-quality-unit-tests.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Integration - Quality & Unit Tests 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | continuous-integration-quality-unit-tests: 7 | name: ${{ matrix.os }} - Python ${{ matrix.python-version }} 8 | strategy: 9 | matrix: 10 | os: [macOS-latest, ubuntu-latest] #, windows-latest] 11 | python-version: [3.13] 12 | fail-fast: false 13 | runs-on: ${{ matrix.os }} 14 | steps: 15 | - uses: actions/checkout@v4 16 | with: 17 | submodules: recursive 18 | - name: Environment Variables 19 | run: | 20 | echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV 21 | echo "CI_PACKAGE=opencolorio_config_aces" >> $GITHUB_ENV 22 | echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV 23 | echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV 24 | shell: bash 25 | - name: Set up Python 3.10 for Pre-Commit 26 | uses: actions/setup-python@v4 27 | with: 28 | python-version: "3.10" 29 | - name: Set up Python ${{ matrix.python-version }} 30 | uses: actions/setup-python@v4 31 | with: 32 | python-version: ${{ matrix.python-version }} 33 | - name: Install uv 34 | run: | 35 | pip install uv 36 | shell: bash 37 | - name: Install Package Dependencies 38 | run: | 39 | uv sync --all-extras --no-dev 40 | uv run python -c "import imageio;imageio.plugins.freeimage.download()" 41 | shell: bash 42 | - name: Pre-Commit (All Files) 43 | run: | 44 | uv run pre-commit run --all-files 45 | shell: bash 46 | - name: Test Optimised Python Execution 47 | run: | 48 | uv run python -OO -c "import $CI_PACKAGE" 49 | shell: bash 50 | - name: Test with Pytest 51 | run: | 52 | uv run python -W ignore -m pytest --disable-warnings --doctest-modules --ignore=$CI_PACKAGE/config/reference/aces-dev --cov=$CI_PACKAGE $CI_PACKAGE 53 | shell: bash 54 | -------------------------------------------------------------------------------- /.github/workflows/continuous-integration-static-type-checking.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Integration - Static Type Checking 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | continuous-integration-static-type-checking: 7 | name: ${{ matrix.os }} - Python ${{ matrix.python-version }} 8 | strategy: 9 | matrix: 10 | os: [macOS-latest] 11 | python-version: [3.13] 12 | fail-fast: false 13 | runs-on: ${{ matrix.os }} 14 | steps: 15 | - uses: actions/checkout@v4 16 | - name: Environment Variables 17 | run: | 18 | echo "CI_PACKAGE=opencolorio_config_aces" >> $GITHUB_ENV 19 | shell: bash 20 | - name: Set up Python ${{ matrix.python-version }} 21 | uses: actions/setup-python@v4 22 | with: 23 | python-version: ${{ matrix.python-version }} 24 | - name: Install Package Dependencies 25 | run: | 26 | cat requirements.txt | grep -Eo '(^[^#]+)' | xargs -n 1 pip install || true 27 | - name: Static Type Checking 28 | run: | 29 | pyright --skipunannotated 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.egg-info 2 | *.pyc 3 | *.pyo 4 | .DS_Store 5 | .coverage 6 | .dmypy.json 7 | .idea 8 | .venv 9 | __pycache__ 10 | build 11 | dist 12 | docs/_build 13 | docs/generated 14 | uv.lock 15 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "opencolorio_config_aces/config/reference/aces-system"] 2 | path = opencolorio_config_aces/config/reference/aces-system 3 | url = https://github.com/colour-science/aces-system 4 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/pre-commit/pre-commit-hooks 3 | rev: "v4.5.0" 4 | hooks: 5 | - id: check-added-large-files 6 | - id: check-case-conflict 7 | - id: check-merge-conflict 8 | - id: check-symlinks 9 | - id: check-yaml 10 | - id: debug-statements 11 | - id: end-of-file-fixer 12 | - id: mixed-line-ending 13 | - id: name-tests-test 14 | args: ["--pytest-test-first"] 15 | - id: requirements-txt-fixer 16 | - id: trailing-whitespace 17 | - repo: https://github.com/codespell-project/codespell 18 | rev: v2.2.6 19 | hooks: 20 | - id: codespell 21 | args: ["--ignore-words-list=co-ordinates,exitance,fro,hart,ist"] 22 | - repo: https://github.com/ikamensh/flynt 23 | rev: "1.0.1" 24 | hooks: 25 | - id: flynt 26 | args: [--verbose] 27 | - repo: https://github.com/PyCQA/isort 28 | rev: "5.13.2" 29 | hooks: 30 | - id: isort 31 | - repo: https://github.com/astral-sh/ruff-pre-commit 32 | rev: "v0.1.14" 33 | hooks: 34 | - id: ruff-format 35 | - id: ruff 36 | - repo: https://github.com/adamchainz/blacken-docs 37 | rev: 1.16.0 38 | hooks: 39 | - id: blacken-docs 40 | language_version: python3.10 41 | - repo: https://github.com/pre-commit/mirrors-prettier 42 | rev: "v3.1.0" 43 | hooks: 44 | - id: prettier 45 | exclude: config-aces-reference.ocio.yaml 46 | - repo: https://github.com/pre-commit/pygrep-hooks 47 | rev: "v1.10.0" 48 | hooks: 49 | - id: rst-backticks 50 | - id: rst-directive-colons 51 | - id: rst-inline-touching-normal 52 | exclude: aces-dev 53 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | build: 4 | os: ubuntu-24.04 5 | tools: 6 | python: "3.13" 7 | apt_packages: 8 | - graphviz 9 | - graphviz-dev 10 | 11 | sphinx: 12 | configuration: docs/conf.py 13 | 14 | formats: 15 | - htmlzip 16 | - pdf 17 | 18 | python: 19 | install: 20 | - requirements: docs/requirements.txt 21 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | # https://hub.docker.com/r/aswf/ci-ocio/tags 5 | FROM aswf/ci-ocio:2021 6 | 7 | # Base Plotting and Docs Building Dependencies. 8 | RUN yum install --setopt=tsflags=nodocs -y \ 9 | graphviz-devel \ 10 | perl-Digest-MD5 11 | 12 | # OpenColorIO Build 13 | WORKDIR /tmp 14 | ARG OCIO_INSTALL_DIRECTORY=/usr/local 15 | RUN git clone --depth 1 https://github.com/AcademySoftwareFoundation/OpenColorIO \ 16 | && cd OpenColorIO \ 17 | && mkdir build \ 18 | && mkdir -p ${OCIO_INSTALL_DIRECTORY} \ 19 | && cd build \ 20 | && cmake -DOCIO_INSTALL_EXT_PACKAGES=ALL -DCMAKE_INSTALL_PREFIX=${OCIO_INSTALL_DIRECTORY} ../ \ 21 | && make -j8 \ 22 | && make install \ 23 | && cd /tmp \ 24 | && rm -rf OpenColorIO 25 | 26 | # LaTeX Dependencies for Sphinx Generated PDF 27 | WORKDIR /tmp 28 | COPY ./utilities/resources/texlive.profile . 29 | RUN wget https://mirrors.rit.edu/CTAN/systems/texlive/tlnet/install-tl-unx.tar.gz \ 30 | && tar -xvf install-tl-unx.tar.gz \ 31 | && cd install-tl-* \ 32 | && perl install-tl --profile ../texlive.profile \ 33 | && tlmgr install \ 34 | capt-of \ 35 | collection-fontsrecommended \ 36 | fncychap \ 37 | fontaxes \ 38 | framed \ 39 | inconsolata \ 40 | latexmk \ 41 | lato \ 42 | needspace \ 43 | tabulary \ 44 | titlesec \ 45 | varwidth \ 46 | wrapfig \ 47 | && tlmgr path add \ 48 | && cd /tmp \ 49 | && rm -rf install-tl* \ 50 | && rm texlive.profile 51 | 52 | # Python Requirements 53 | WORKDIR /tmp 54 | COPY ./requirements.txt /tmp 55 | RUN sed -i 's//"cgraph.h"/g' /usr/include/graphviz/types.h 56 | RUN pip install -r requirements.txt \ 57 | && rm /tmp/requirements.txt 58 | 59 | # Environment Variables & Working Directory 60 | ARG WORKING_DIRECTORY=/home/aswf/OpenColorIO-Config-ACES 61 | ENV PYTHONPATH=${WORKING_DIRECTORY}:${PYTHONPATH} 62 | WORKDIR ${WORKING_DIRECTORY} 63 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Contributors to the OpenColorIO Project. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of the copyright holder nor the names of its 13 | contributors may be used to endorse or promote products derived from 14 | this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | # Makefile for Sphinx documentation 5 | # 6 | 7 | # You can set these variables from the command line. 8 | SPHINXOPTS = 9 | SPHINXBUILD = sphinx-build 10 | PAPER = 11 | BUILDDIR = _build 12 | 13 | # User-friendly check for sphinx-build 14 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 15 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 16 | endif 17 | 18 | # Internal variables. 19 | PAPEROPT_a4 = -D latex_paper_size=a4 20 | PAPEROPT_letter = -D latex_paper_size=letter 21 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 22 | # the i18n builder cannot share the environment and doctrees with the others 23 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 24 | 25 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext 26 | 27 | help: 28 | @echo "Please use \`make ' where is one of" 29 | @echo " html to make standalone HTML files" 30 | @echo " dirhtml to make HTML files named index.html in directories" 31 | @echo " singlehtml to make a single large HTML file" 32 | @echo " pickle to make pickle files" 33 | @echo " json to make JSON files" 34 | @echo " htmlhelp to make HTML files and a HTML help project" 35 | @echo " qthelp to make HTML files and a qthelp project" 36 | @echo " devhelp to make HTML files and a Devhelp project" 37 | @echo " epub to make an epub" 38 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 39 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 40 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 41 | @echo " text to make text files" 42 | @echo " man to make manual pages" 43 | @echo " texinfo to make Texinfo files" 44 | @echo " info to make Texinfo files and run them through makeinfo" 45 | @echo " gettext to make PO message catalogs" 46 | @echo " changes to make an overview of all changed/added/deprecated items" 47 | @echo " xml to make Docutils-native XML files" 48 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 49 | @echo " linkcheck to check all external links for integrity" 50 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 51 | 52 | clean: 53 | rm -rf $(BUILDDIR)/* 54 | 55 | html: 56 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 57 | @echo 58 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 59 | 60 | dirhtml: 61 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 62 | @echo 63 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 64 | 65 | singlehtml: 66 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 67 | @echo 68 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 69 | 70 | pickle: 71 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 72 | @echo 73 | @echo "Build finished; now you can process the pickle files." 74 | 75 | json: 76 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 77 | @echo 78 | @echo "Build finished; now you can process the JSON files." 79 | 80 | htmlhelp: 81 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 82 | @echo 83 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 84 | ".hhp project file in $(BUILDDIR)/htmlhelp." 85 | 86 | qthelp: 87 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 88 | @echo 89 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 90 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 91 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/colour_demosaicing.qhcp" 92 | @echo "To view the help file:" 93 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/colour_demosaicing.qhc" 94 | 95 | devhelp: 96 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 97 | @echo 98 | @echo "Build finished." 99 | @echo "To view the help file:" 100 | @echo "# mkdir -p $$HOME/.local/share/devhelp/colour_demosaicing" 101 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/colour_demosaicing" 102 | @echo "# devhelp" 103 | 104 | epub: 105 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 106 | @echo 107 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 108 | 109 | latex: 110 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 111 | @echo 112 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 113 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 114 | "(use \`make latexpdf' here to do that automatically)." 115 | 116 | latexpdf: 117 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 118 | @echo "Running LaTeX files through pdflatex..." 119 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 120 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 121 | 122 | latexpdfja: 123 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 124 | @echo "Running LaTeX files through platex and dvipdfmx..." 125 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 126 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 127 | 128 | text: 129 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 130 | @echo 131 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 132 | 133 | man: 134 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 135 | @echo 136 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 137 | 138 | texinfo: 139 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 140 | @echo 141 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 142 | @echo "Run \`make' in that directory to run these through makeinfo" \ 143 | "(use \`make info' here to do that automatically)." 144 | 145 | info: 146 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 147 | @echo "Running Texinfo files through makeinfo..." 148 | make -C $(BUILDDIR)/texinfo info 149 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 150 | 151 | gettext: 152 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 153 | @echo 154 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 155 | 156 | changes: 157 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 158 | @echo 159 | @echo "The overview file is in $(BUILDDIR)/changes." 160 | 161 | linkcheck: 162 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 163 | @echo 164 | @echo "Link check complete; look for any errors in the above output " \ 165 | "or in $(BUILDDIR)/linkcheck/output.txt." 166 | 167 | doctest: 168 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 169 | @echo "Testing of doctests in the sources finished, look at the " \ 170 | "results in $(BUILDDIR)/doctest/output.txt." 171 | 172 | xml: 173 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 174 | @echo 175 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 176 | 177 | pseudoxml: 178 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 179 | @echo 180 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 181 | -------------------------------------------------------------------------------- /docs/_templates/class.rst: -------------------------------------------------------------------------------- 1 | .. 2 | SPDX-License-Identifier: CC-BY-4.0 3 | Copyright Contributors to the OpenColorIO Project. 4 | 5 | {{ fullname | escape | underline}} 6 | 7 | .. currentmodule:: {{ module }} 8 | 9 | .. autoclass:: {{ objname }} 10 | :members: 11 | :show-inheritance: 12 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | """ 5 | OpenColorIO Configuration for ACES - Documentation Configuration 6 | ================================================================ 7 | """ 8 | 9 | import sys 10 | from pathlib import Path 11 | 12 | sys.path.append(str(Path(__file__).parent.parent)) 13 | 14 | import opencolorio_config_aces as package # noqa: E402 15 | 16 | basename = package.__name__.replace("_", "-") 17 | 18 | # -- General configuration ------------------------------------------------ 19 | extensions = [ 20 | "sphinx.ext.autodoc", 21 | "sphinx.ext.intersphinx", 22 | "sphinx.ext.todo", 23 | "sphinx.ext.coverage", 24 | "sphinx.ext.ifconfig", 25 | "sphinx.ext.viewcode", 26 | "sphinx.ext.autosummary", 27 | "sphinx.ext.napoleon", 28 | "sphinx.ext.mathjax", 29 | ] 30 | 31 | intersphinx_mapping = {"python": ("https://docs.python.org/3.13", None)} 32 | 33 | autosummary_generate = True 34 | 35 | autodoc_mock_imports = [] 36 | 37 | autoclass_content = "both" 38 | 39 | templates_path = ["_templates"] 40 | source_suffix = ".rst" 41 | master_doc = "index" 42 | 43 | project = package.__application_name__ 44 | copyright = package.__copyright__ # noqa: A001 45 | version = f"{package.__major_version__}.{package.__minor_version__}" 46 | release = package.__version__ 47 | 48 | exclude_patterns = ["_build"] 49 | 50 | pygments_style = "lovelace" 51 | 52 | # -- Options for HTML output ---------------------------------------------- 53 | 54 | html_theme = "pydata_sphinx_theme" 55 | html_theme_options = { 56 | "show_nav_level": 2, 57 | "icon_links": [ 58 | { 59 | "name": "Email", 60 | "url": "https://lists.aswf.io/g/ocio-dev", 61 | "icon": "fas fa-envelope", 62 | }, 63 | { 64 | "name": "GitHub", 65 | "url": ( 66 | "https://github.com/AcademySoftwareFoundation/" 67 | "OpenColorIO-Config-ACES" 68 | ), 69 | "icon": "fab fa-github", 70 | }, 71 | ], 72 | } 73 | html_static_path = ["_static"] 74 | htmlhelp_basename = f"{basename}Doc" 75 | 76 | # -- Options for LaTeX output --------------------------------------------- 77 | latex_elements = { 78 | "papersize": "a4paper", 79 | "pointsize": "10pt", 80 | "preamble": """ 81 | \\usepackage{charter} 82 | \\usepackage[defaultsans]{lato} 83 | \\usepackage{inconsolata} 84 | """, 85 | } 86 | latex_documents = [ 87 | ( 88 | "index", 89 | f"{basename}.tex", 90 | f"{package.__application_name__} Documentation", 91 | package.__author__, 92 | "manual", 93 | ), 94 | ] 95 | 96 | # -- Options for manual page output --------------------------------------- 97 | man_pages = [ 98 | ( 99 | "index", 100 | basename, 101 | f"{package.__application_name__} Documentation", 102 | [package.__author__], 103 | 1, 104 | ) 105 | ] 106 | 107 | # -- Options for Texinfo output ------------------------------------------- 108 | texinfo_documents = [ 109 | ( 110 | "index", 111 | basename, 112 | f"{package.__application_name__} Documentation", 113 | package.__author__, 114 | package.__application_name__, 115 | basename, 116 | "Miscellaneous", 117 | ), 118 | ] 119 | # -- Options for Epub output ---------------------------------------------- 120 | epub_title = package.__application_name__ 121 | epub_author = package.__author__ 122 | epub_publisher = package.__author__ 123 | epub_copyright = package.__copyright__.replace("Copyright (C)", "") 124 | epub_exclude_files = ["search.html"] 125 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. 2 | SPDX-License-Identifier: CC-BY-4.0 3 | Copyright Contributors to the OpenColorIO Project. 4 | 5 | OpenColorIO Configuration for ACES 6 | ================================== 7 | 8 | The `OpenColorIO Configuration for ACES `__ 9 | is an open-source `Python `__ package implementing 10 | support for the generation of the *OCIO* configurations for the 11 | `Academy Color Encoding System `__ 12 | (ACES). 13 | 14 | It is freely available under the 15 | `New BSD License `__ terms. 16 | 17 | .. sectnum:: 18 | 19 | Features 20 | -------- 21 | 22 | The following features are available: 23 | 24 | - Automatic *OCIO* **Reference** configuration generation for *aces-dev* 25 | *CTL* reference implementation. 26 | 27 | - Discovery of *aces-dev* *CTL* transforms. 28 | - Generation of the *CTL* transforms graph. 29 | - `Spreadsheet `__-driven generation. 30 | 31 | - Generators producing the *OCIO* **CG** and **Studio** configurations. 32 | - `Spreadsheet `__-driven generation. 33 | 34 | - Included *CLF* transforms along with generator and discovery support. 35 | 36 | User Guide 37 | ---------- 38 | 39 | .. toctree:: 40 | :maxdepth: 2 41 | 42 | user-guide 43 | 44 | API Reference 45 | ------------- 46 | 47 | .. toctree:: 48 | :maxdepth: 2 49 | 50 | reference 51 | 52 | About 53 | ----- 54 | 55 | | **OpenColorIO Configuration for ACES** by OpenColorIO Contributors 56 | | Copyright Contributors to the OpenColorIO Project – `ocio-dev@lists.aswf.io `__ 57 | | This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause 58 | | `https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES `__ 59 | -------------------------------------------------------------------------------- /docs/installation.rst: -------------------------------------------------------------------------------- 1 | .. 2 | SPDX-License-Identifier: CC-BY-4.0 3 | Copyright Contributors to the OpenColorIO Project. 4 | 5 | Installation Guide 6 | ================== 7 | 8 | Cloning the Repository 9 | ---------------------- 10 | 11 | The *OpenColorIO Configuration for ACES* repository uses `Git submodules `__ 12 | thus cloning the repository requires initializing them:: 13 | 14 | git clone --recursive https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES.git 15 | 16 | If you have already cloned the repository and forgot the ``--recursive`` 17 | argument, it is possible to initialize the submodules as follows:: 18 | 19 | git submodule update --init --recursive 20 | 21 | uv 22 | ~~ 23 | 24 | The *OpenColorIO Configuration for ACES* repository adopts `uv `__ 25 | to help managing its dependencies, this is the recommended way to get started 26 | with development. 27 | 28 | Assuming `python >= 3.10 `__ is 29 | available on your system along with `OpenColorIO `__, 30 | the development dependencies are installed with `uv `__ 31 | as follows:: 32 | 33 | git clone --recursive https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES.git 34 | cd OpenColorIO-Config-ACES 35 | uv sync --all-extras 36 | 37 | The *aces-dev* *CTL* reference graph can be plotted but it requires `Graphviz `__ 38 | to be installed on the system. 39 | 40 | Docker 41 | ~~~~~~ 42 | 43 | Installing the dependencies for the `previous config generator `__ 44 | was not a trivial task. For ease of use an `aswf-docker `__ 45 | based container is now available. 46 | 47 | Creating the container from the `Dockerfile `__ 48 | is done as follows:: 49 | 50 | docker build -t aswf/opencolorio-config-aces:latest . 51 | 52 | or alternatively, if the dependencies described in the next section are 53 | satisfied:: 54 | 55 | invoke docker build 56 | 57 | Then, to run *bash* in the container:: 58 | 59 | docker run -it -v ${PWD}:/home/aswf/OpenColorIO-Config-ACES aswf/opencolorio-config-aces:latest /bin/bash 60 | 61 | Pypi 62 | ~~~~ 63 | 64 | The **OpenColorIO Configuration for ACES** package requires various 65 | dependencies in order to run and be able to generate the *OCIO* configurations: 66 | 67 | Primary Dependencies 68 | ~~~~~~~~~~~~~~~~~~~~ 69 | 70 | - `python >= 3.10, < 3.14 `__ 71 | - `opencolorio `__ 72 | - `requests `__ 73 | - `semver `__ 74 | 75 | Optional Dependencies 76 | ~~~~~~~~~~~~~~~~~~~~~ 77 | 78 | - `colour-science `__ 79 | - `graphviz `__ 80 | - `jsonpickle `__ 81 | - `networkx `__ 82 | - `pydot `__ 83 | 84 | Docs Dependencies 85 | ~~~~~~~~~~~~~~~~~ 86 | 87 | - `pydata-sphinx-theme `__ 88 | - `sphinx `__ 89 | 90 | Development Dependencies 91 | ~~~~~~~~~~~~~~~~~~~~~~~~ 92 | 93 | - `coverage `__ 94 | - `coveralls `__ 95 | - `hatch `__ 96 | - `invoke `__ 97 | - `pre-commit `__ 98 | - `pyright `__ 99 | - `pytest `__ 100 | - `pytest-cov `__ 101 | - `pytest-xdist `__ 102 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | REM SPDX-License-Identifier: BSD-3-Clause 2 | REM Copyright Contributors to the OpenColorIO Project. 3 | 4 | @ECHO OFF 5 | 6 | REM Command file for Sphinx documentation 7 | 8 | if "%SPHINXBUILD%" == "" ( 9 | set SPHINXBUILD=sphinx-build 10 | ) 11 | set BUILDDIR=_build 12 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 13 | set I18NSPHINXOPTS=%SPHINXOPTS% . 14 | if NOT "%PAPER%" == "" ( 15 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 16 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 17 | ) 18 | 19 | if "%1" == "" goto help 20 | 21 | if "%1" == "help" ( 22 | :help 23 | echo.Please use `make ^` where ^ is one of 24 | echo. html to make standalone HTML files 25 | echo. dirhtml to make HTML files named index.html in directories 26 | echo. singlehtml to make a single large HTML file 27 | echo. pickle to make pickle files 28 | echo. json to make JSON files 29 | echo. htmlhelp to make HTML files and a HTML help project 30 | echo. qthelp to make HTML files and a qthelp project 31 | echo. devhelp to make HTML files and a Devhelp project 32 | echo. epub to make an epub 33 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 34 | echo. text to make text files 35 | echo. man to make manual pages 36 | echo. texinfo to make Texinfo files 37 | echo. gettext to make PO message catalogs 38 | echo. changes to make an overview over all changed/added/deprecated items 39 | echo. xml to make Docutils-native XML files 40 | echo. pseudoxml to make pseudoxml-XML files for display purposes 41 | echo. linkcheck to check all external links for integrity 42 | echo. doctest to run all doctests embedded in the documentation if enabled 43 | goto end 44 | ) 45 | 46 | if "%1" == "clean" ( 47 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 48 | del /q /s %BUILDDIR%\* 49 | goto end 50 | ) 51 | 52 | 53 | %SPHINXBUILD% 2> nul 54 | if errorlevel 9009 ( 55 | echo. 56 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 57 | echo.installed, then set the SPHINXBUILD environment variable to point 58 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 59 | echo.may add the Sphinx directory to PATH. 60 | echo. 61 | echo.If you don't have Sphinx installed, grab it from 62 | echo.http://sphinx-doc.org/ 63 | exit /b 1 64 | ) 65 | 66 | if "%1" == "html" ( 67 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 68 | if errorlevel 1 exit /b 1 69 | echo. 70 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 71 | goto end 72 | ) 73 | 74 | if "%1" == "dirhtml" ( 75 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 76 | if errorlevel 1 exit /b 1 77 | echo. 78 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 79 | goto end 80 | ) 81 | 82 | if "%1" == "singlehtml" ( 83 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 84 | if errorlevel 1 exit /b 1 85 | echo. 86 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 87 | goto end 88 | ) 89 | 90 | if "%1" == "pickle" ( 91 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 92 | if errorlevel 1 exit /b 1 93 | echo. 94 | echo.Build finished; now you can process the pickle files. 95 | goto end 96 | ) 97 | 98 | if "%1" == "json" ( 99 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 100 | if errorlevel 1 exit /b 1 101 | echo. 102 | echo.Build finished; now you can process the JSON files. 103 | goto end 104 | ) 105 | 106 | if "%1" == "htmlhelp" ( 107 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 108 | if errorlevel 1 exit /b 1 109 | echo. 110 | echo.Build finished; now you can run HTML Help Workshop with the ^ 111 | .hhp project file in %BUILDDIR%/htmlhelp. 112 | goto end 113 | ) 114 | 115 | if "%1" == "qthelp" ( 116 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 117 | if errorlevel 1 exit /b 1 118 | echo. 119 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 120 | .qhcp project file in %BUILDDIR%/qthelp, like this: 121 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\colour_demosaicing.qhcp 122 | echo.To view the help file: 123 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\colour_demosaicing.ghc 124 | goto end 125 | ) 126 | 127 | if "%1" == "devhelp" ( 128 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 129 | if errorlevel 1 exit /b 1 130 | echo. 131 | echo.Build finished. 132 | goto end 133 | ) 134 | 135 | if "%1" == "epub" ( 136 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 137 | if errorlevel 1 exit /b 1 138 | echo. 139 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 140 | goto end 141 | ) 142 | 143 | if "%1" == "latex" ( 144 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 145 | if errorlevel 1 exit /b 1 146 | echo. 147 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 148 | goto end 149 | ) 150 | 151 | if "%1" == "latexpdf" ( 152 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 153 | cd %BUILDDIR%/latex 154 | make all-pdf 155 | cd %BUILDDIR%/.. 156 | echo. 157 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 158 | goto end 159 | ) 160 | 161 | if "%1" == "latexpdfja" ( 162 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 163 | cd %BUILDDIR%/latex 164 | make all-pdf-ja 165 | cd %BUILDDIR%/.. 166 | echo. 167 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 168 | goto end 169 | ) 170 | 171 | if "%1" == "text" ( 172 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 173 | if errorlevel 1 exit /b 1 174 | echo. 175 | echo.Build finished. The text files are in %BUILDDIR%/text. 176 | goto end 177 | ) 178 | 179 | if "%1" == "man" ( 180 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 181 | if errorlevel 1 exit /b 1 182 | echo. 183 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 184 | goto end 185 | ) 186 | 187 | if "%1" == "texinfo" ( 188 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 189 | if errorlevel 1 exit /b 1 190 | echo. 191 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 192 | goto end 193 | ) 194 | 195 | if "%1" == "gettext" ( 196 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 197 | if errorlevel 1 exit /b 1 198 | echo. 199 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 200 | goto end 201 | ) 202 | 203 | if "%1" == "changes" ( 204 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 205 | if errorlevel 1 exit /b 1 206 | echo. 207 | echo.The overview file is in %BUILDDIR%/changes. 208 | goto end 209 | ) 210 | 211 | if "%1" == "linkcheck" ( 212 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 213 | if errorlevel 1 exit /b 1 214 | echo. 215 | echo.Link check complete; look for any errors in the above output ^ 216 | or in %BUILDDIR%/linkcheck/output.txt. 217 | goto end 218 | ) 219 | 220 | if "%1" == "doctest" ( 221 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 222 | if errorlevel 1 exit /b 1 223 | echo. 224 | echo.Testing of doctests in the sources finished, look at the ^ 225 | results in %BUILDDIR%/doctest/output.txt. 226 | goto end 227 | ) 228 | 229 | if "%1" == "xml" ( 230 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml 231 | if errorlevel 1 exit /b 1 232 | echo. 233 | echo.Build finished. The XML files are in %BUILDDIR%/xml. 234 | goto end 235 | ) 236 | 237 | if "%1" == "pseudoxml" ( 238 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml 239 | if errorlevel 1 exit /b 1 240 | echo. 241 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. 242 | goto end 243 | ) 244 | 245 | :end 246 | -------------------------------------------------------------------------------- /docs/opencolorio_config_aces.clf.rst: -------------------------------------------------------------------------------- 1 | .. 2 | SPDX-License-Identifier: CC-BY-4.0 3 | Copyright Contributors to the OpenColorIO Project. 4 | 5 | Common LUT Format Discovery 6 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7 | 8 | ``opencolorio_config_aces`` 9 | 10 | .. currentmodule:: opencolorio_config_aces 11 | 12 | .. autosummary:: 13 | :toctree: generated/ 14 | 15 | discover_clf_transforms 16 | classify_clf_transforms 17 | unclassify_clf_transforms 18 | filter_clf_transforms 19 | print_clf_taxonomy 20 | 21 | Common LUT Format Generation 22 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 23 | 24 | ``opencolorio_config_aces`` 25 | 26 | .. currentmodule:: opencolorio_config_aces 27 | 28 | .. autosummary:: 29 | :toctree: generated/ 30 | 31 | generate_clf_transform 32 | 33 | **Ancillary Objects** 34 | 35 | ``opencolorio_config_aces.clf`` 36 | 37 | .. currentmodule:: opencolorio_config_aces.clf 38 | 39 | .. autosummary:: 40 | :toctree: generated/ 41 | 42 | generate_clf_transforms_arri 43 | generate_clf_transforms_bmdfilm 44 | generate_clf_transforms_canon 45 | generate_clf_transforms_davinci 46 | generate_clf_transforms_itu 47 | generate_clf_transforms_ocio 48 | generate_clf_transforms_panasonic 49 | generate_clf_transforms_red 50 | generate_clf_transforms_sony 51 | -------------------------------------------------------------------------------- /docs/opencolorio_config_aces.config.rst: -------------------------------------------------------------------------------- 1 | .. 2 | SPDX-License-Identifier: CC-BY-4.0 3 | Copyright Contributors to the OpenColorIO Project. 4 | 5 | Generation 6 | ========== 7 | 8 | Version Utilities 9 | ----------------- 10 | 11 | ``opencolorio_config_aces`` 12 | 13 | .. currentmodule:: opencolorio_config_aces 14 | 15 | .. autosummary:: 16 | :toctree: generated/ 17 | 18 | PROFILE_VERSION_DEFAULT 19 | PROFILE_VERSIONS 20 | 21 | Build Configuration Utilities 22 | ----------------------------- 23 | 24 | ``opencolorio_config_aces`` 25 | 26 | .. currentmodule:: opencolorio_config_aces 27 | 28 | .. autosummary:: 29 | :toctree: generated/ 30 | 31 | BUILD_CONFIGURATIONS 32 | BUILD_VARIANT_FILTERERS 33 | BuildConfiguration 34 | 35 | Config Generation Common Objects 36 | -------------------------------- 37 | 38 | ``opencolorio_config_aces`` 39 | 40 | .. currentmodule:: opencolorio_config_aces 41 | 42 | .. autosummary:: 43 | :toctree: generated/ 44 | 45 | ConfigData 46 | deserialize_config_data 47 | generate_config 48 | serialize_config_data 49 | validate_config 50 | 51 | Factories 52 | ~~~~~~~~~ 53 | 54 | ``opencolorio_config_aces`` 55 | 56 | .. autosummary:: 57 | :toctree: generated/ 58 | 59 | BUILTIN_TRANSFORMS 60 | TRANSFORM_FACTORIES 61 | colorspace_factory 62 | group_transform_factory 63 | look_factory 64 | named_transform_factory 65 | produce_transform 66 | transform_factory 67 | view_transform_factory 68 | 69 | Reference Configuration 70 | ----------------------- 71 | 72 | *aces-dev* Discovery 73 | ~~~~~~~~~~~~~~~~~~~~ 74 | 75 | ``opencolorio_config_aces`` 76 | 77 | .. currentmodule:: opencolorio_config_aces 78 | 79 | .. autosummary:: 80 | :toctree: generated/ 81 | 82 | version_aces_dev 83 | classify_aces_ctl_transforms 84 | discover_aces_ctl_transforms 85 | filter_ctl_transforms 86 | generate_amf_components 87 | print_aces_taxonomy 88 | unclassify_ctl_transforms 89 | 90 | *aces-dev* Conversion Graph 91 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 92 | 93 | ``opencolorio_config_aces`` 94 | 95 | .. currentmodule:: opencolorio_config_aces 96 | 97 | .. autosummary:: 98 | :toctree: generated/ 99 | 100 | build_aces_conversion_graph 101 | conversion_path 102 | ctl_transform_to_node 103 | filter_nodes 104 | node_to_ctl_transform 105 | plot_aces_conversion_graph 106 | 107 | *aces-dev* Reference Config Generator 108 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 109 | 110 | ``opencolorio_config_aces`` 111 | 112 | .. currentmodule:: opencolorio_config_aces 113 | 114 | .. autosummary:: 115 | :toctree: generated/ 116 | 117 | DescriptionStyle 118 | generate_config_aces 119 | 120 | *ACES* Computer Graphics (CG) Config Generator 121 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 122 | 123 | ``opencolorio_config_aces`` 124 | 125 | .. currentmodule:: opencolorio_config_aces 126 | 127 | .. autosummary:: 128 | :toctree: generated/ 129 | 130 | generate_config_cg 131 | 132 | *ACES* Studio Config Generator 133 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 134 | 135 | ``opencolorio_config_aces`` 136 | 137 | .. currentmodule:: opencolorio_config_aces 138 | 139 | .. autosummary:: 140 | :toctree: generated/ 141 | 142 | generate_config_studio 143 | 144 | Generation Utilities 145 | ~~~~~~~~~~~~~~~~~~~~ 146 | 147 | ``opencolorio_config_aces`` 148 | 149 | .. autosummary:: 150 | :toctree: generated/ 151 | 152 | BUILTIN_TRANSFORMS 153 | -------------------------------------------------------------------------------- /docs/opencolorio_config_aces.rst: -------------------------------------------------------------------------------- 1 | .. 2 | SPDX-License-Identifier: CC-BY-4.0 3 | Copyright Contributors to the OpenColorIO Project. 4 | 5 | OpenColorIO Configuration for ACES 6 | ================================== 7 | 8 | .. toctree:: 9 | :maxdepth: 3 10 | 11 | opencolorio_config_aces.clf 12 | opencolorio_config_aces.config 13 | opencolorio_config_aces.utilities 14 | -------------------------------------------------------------------------------- /docs/opencolorio_config_aces.utilities.rst: -------------------------------------------------------------------------------- 1 | .. 2 | SPDX-License-Identifier: CC-BY-4.0 3 | Copyright Contributors to the OpenColorIO Project. 4 | 5 | Utilities 6 | ========= 7 | 8 | Common 9 | ------ 10 | 11 | ``opencolorio_config_aces.utilities`` 12 | 13 | .. currentmodule:: opencolorio_config_aces.utilities 14 | 15 | .. autosummary:: 16 | :toctree: generated/ 17 | 18 | ROOT_BUILD_DEFAULT 19 | DocstringDict 20 | first_item 21 | common_ancestor 22 | paths_common_ancestor 23 | vivification 24 | vivified_to_dict 25 | message_box 26 | is_colour_installed 27 | is_jsonpickle_installed 28 | is_networkx_installed 29 | REQUIREMENTS_TO_CALLABLE 30 | required 31 | is_string 32 | is_iterable 33 | git_describe 34 | matrix_3x3_to_4x4 35 | multi_replace 36 | validate_method 37 | google_sheet_title 38 | slugify 39 | attest 40 | timestamp 41 | as_bool 42 | optional 43 | -------------------------------------------------------------------------------- /docs/process.rst: -------------------------------------------------------------------------------- 1 | .. 2 | SPDX-License-Identifier: CC-BY-4.0 3 | Copyright Contributors to the OpenColorIO Project. 4 | 5 | Process 6 | ======= 7 | 8 | aces-dev Discovery & Classification 9 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10 | 11 | The config generation process starts with a set of definitions and classes to discover, parse and classify the CTL transforms from `aces-dev `__: 12 | 13 | - :func:`opencolorio_config_aces.discover_aces_ctl_transforms` 14 | - :func:`opencolorio_config_aces.classify_aces_ctl_transforms` 15 | - :func:`opencolorio_config_aces.print_aces_taxonomy` 16 | 17 | .. note:: This approach allowed us to improve the consistency of the **CTL** transforms ``ACEStransformID`` while fixing various filename issues. 18 | 19 | Using ``ACES2065-1`` as connection spaces, it is possible to build a colour conversion graph with all the high-level relevant transforms. 20 | 21 | - :func:`opencolorio_config_aces.build_aces_conversion_graph` 22 | - :func:`opencolorio_config_aces.plot_aces_conversion_graph` 23 | 24 | .. only:: html 25 | 26 | .. image:: _static/ACES_Conversion_Graph.svg 27 | 28 | An initial mapping of *ACES* **AMF** components is generated after the classification process. The mapping defines the ``ACEStransformID`` relationships. Its generation is automated but needs to be guided by an external file, i.e., ``opencolorio_config_aces/config/reference/discover/resources/ACES_AMF_Components.json``, because a few relationships cannot be derived automatically. 29 | 30 | Analytical & Reference Configs Generation 31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 32 | 33 | The colour conversion graph is then used to create the *Analytical* config that maps 1-to-1 the **aces-dev** **CTL** transforms to theoretical **OpenColorIO** builtin transforms. 34 | This config does not work but it is useful to test basic generation capabilities whilst diagnosing issues in the mapping. 35 | 36 | The *Reference* config is driven by a *CSV* file generated from a `spreadsheet `__ mapping the ``ACEStransformID`` to **OpenColorIO** builtin transforms. 37 | 38 | - :func:`opencolorio_config_aces.generate_config_aces` 39 | 40 | CLF Transforms Generation, Discovery & Classification 41 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 42 | 43 | The working group decided to express additional colour transforms using `CLF `__. 44 | Some *CLF* transforms can be serialised into a config which reduces the need for external files. Each *CLF* transform has a ``CLFtransformID`` specified according to the `CLF Formatting for ACES OCIO Config `__ document. 45 | 46 | The repository contains code to generate, discover and classify the additional *CLF* transforms that the *CG* and *Studio* configs require. 47 | 48 | - :func:`opencolorio_config_aces.discover_clf_transforms` 49 | - :func:`opencolorio_config_aces.classify_clf_transforms` 50 | - :func:`opencolorio_config_aces.print_clf_taxonomy` 51 | 52 | CG Config Generation 53 | ^^^^^^^^^^^^^^^^^^^^ 54 | 55 | The *CG* config generator also uses a *CSV* file generated from a `spreadsheet `__ pivot table that expresses which ``ACEStransformID`` should be used from the ``Reference`` config and which ``CLFtransformID`` should be used from the shipped *CLF* transforms. 56 | 57 | - :func:`opencolorio_config_aces.generate_config_cg` 58 | 59 | The conversion process is as follows: 60 | 61 | *aces-dev Discovery & Classification* -> *Reference Config Generation* -> *CLF Transforms Generation, Discovery & Classification* -> *CG Config Generation* 62 | 63 | Studio Config Generation 64 | ^^^^^^^^^^^^^^^^^^^^^^^^ 65 | 66 | The *Studio* config generator follows the same approach but uses a different `pivot table `__ of the spreadsheet. 67 | 68 | - :func:`opencolorio_config_aces.generate_config_studio` 69 | 70 | The conversion process is as follows: 71 | 72 | *aces-dev Discovery & Classification* -> *Reference Config Generation* -> *CLF Transforms Generation, Discovery & Classification* -> *Studio Config Generation* 73 | 74 | Config Versioning Rules 75 | ======================= 76 | 77 | The following rules have been adopted to version up the config name colorspaces: 78 | 79 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 80 | | Major Version Increase | Minor Version Increase | Patch Version Increase | 81 | +===========================================+========================================+=======================================================+ 82 | | Remove **Colorspace** | Add **Colorspace** | Add **Colorspace** to ``inactive_colorspaces`` | 83 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 84 | | Remove **Look** | Add **Look** | Add **Look** to ``inactive_colorspaces`` | 85 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 86 | | Remove **NamedTransform** | Add **NamedTransform** | Add **NamedTransform** to ``inactive_colorspaces`` | 87 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 88 | | Remove **DisplayColorspace** | Add **DisplayColorspace** | Add **DisplayColorspace** to ``inactive_colorspaces`` | 89 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 90 | | Remove **ViewTransform** / **SharedView** | Add **ViewTransform** / **SharedView** | | 91 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 92 | | Remove **Role** | Add **Role** | | 93 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 94 | | Reassign **Role** | | | 95 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 96 | | Change to Transform Processing Output | | Fix Incorrect Transform Processing Output? | 97 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 98 | | Remove alias from ``aliases`` | Add alias to ``aliases`` | | 99 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 100 | | Remove *AMF* component | Add *AMF* component | | 101 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 102 | | | | Change to ``categories`` | 103 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 104 | | | | Change to ``encoding`` | 105 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 106 | | | | Change to ``family`` | 107 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 108 | | | | Change to Transform Description | 109 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 110 | | | | Change to Config Description | 111 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 112 | | | | Change to ``file_rules`` | 113 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 114 | | | | Change to ``viewing_rules`` | 115 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 116 | | | | Change to ``active_displays`` | 117 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 118 | | | | Change to ``active_views`` | 119 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 120 | | | | Change to ``inactive_colorspaces`` | 121 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 122 | | | | Reassign ``default_view_transform`` | 123 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 124 | | Change ``luma``? | | | 125 | +-------------------------------------------+----------------------------------------+-------------------------------------------------------+ 126 | -------------------------------------------------------------------------------- /docs/reference.rst: -------------------------------------------------------------------------------- 1 | .. 2 | SPDX-License-Identifier: CC-BY-4.0 3 | Copyright Contributors to the OpenColorIO Project. 4 | 5 | API Reference 6 | ============= 7 | 8 | .. toctree:: 9 | :titlesonly: 10 | 11 | opencolorio_config_aces 12 | 13 | Indices and tables 14 | ------------------ 15 | 16 | * :ref:`genindex` 17 | * :ref:`search` 18 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by uv via the following command: 2 | # uv export --no-hashes --all-extras --no-dev 3 | accessible-pygments==0.0.5 4 | alabaster==1.0.0 5 | babel==2.17.0 6 | beautifulsoup4==4.13.3 7 | certifi==2025.1.31 8 | charset-normalizer==3.4.1 9 | colorama==0.4.6 ; sys_platform == 'win32' 10 | colour-science==0.4.6 11 | docutils==0.21.2 12 | idna==3.10 13 | imageio==2.37.0 14 | imagesize==1.4.1 15 | jinja2==3.1.6 16 | jsonpickle==4.0.2 17 | markupsafe==3.0.2 18 | networkx==3.4.2 19 | numpy==2.2.3 20 | opencolorio==2.4.1 21 | packaging==24.2 22 | pillow==11.1.0 23 | pydata-sphinx-theme==0.16.1 24 | pydot==3.0.4 25 | pygments==2.19.1 26 | pyparsing==3.2.1 27 | requests==2.32.3 28 | scipy==1.15.2 29 | semver==3.0.4 30 | snowballstemmer==2.2.0 31 | soupsieve==2.6 32 | sphinx==8.1.3 33 | sphinxcontrib-applehelp==2.0.0 34 | sphinxcontrib-devhelp==2.0.0 35 | sphinxcontrib-htmlhelp==2.1.0 36 | sphinxcontrib-jsmath==1.0.1 37 | sphinxcontrib-qthelp==2.0.0 38 | sphinxcontrib-serializinghtml==2.0.0 39 | tomli==2.2.1 ; python_full_version < '3.11' 40 | typing-extensions==4.12.2 41 | urllib3==2.3.0 42 | -------------------------------------------------------------------------------- /docs/usage.rst: -------------------------------------------------------------------------------- 1 | .. 2 | SPDX-License-Identifier: CC-BY-4.0 3 | Copyright Contributors to the OpenColorIO Project. 4 | 5 | Usage 6 | ===== 7 | 8 | Tasks 9 | ^^^^^ 10 | 11 | Various tasks are currently exposed via `invoke `__. 12 | 13 | This is currently the recommended way to build the configuration until a 14 | dedicated CLI is provided. 15 | 16 | Listing the tasks is done as follows:: 17 | 18 | invoke --list 19 | 20 | Reference Config 21 | **************** 22 | 23 | +-----------------------+----------------------------------------------+ 24 | | Task | Command | 25 | +-----------------------+----------------------------------------------+ 26 | | Build | ``invoke build-config-reference`` | 27 | +-----------------------+----------------------------------------------+ 28 | | Build (Docker) | ``invoke docker-run-build-config-reference`` | 29 | +-----------------------+----------------------------------------------+ 30 | | Updating Mapping File | ``invoke update-mapping-file-reference`` | 31 | +-----------------------+----------------------------------------------+ 32 | 33 | CG Config 34 | ********* 35 | 36 | +-----------------------+---------------------------------------+ 37 | | Task | Command | 38 | +-----------------------+---------------------------------------+ 39 | | Build | ``invoke build-config-cg`` | 40 | +-----------------------+---------------------------------------+ 41 | | Build (Docker) | ``invoke docker-run-build-config-cg`` | 42 | +-----------------------+---------------------------------------+ 43 | | Updating Mapping File | ``invoke update-mapping-file-cg`` | 44 | +-----------------------+---------------------------------------+ 45 | 46 | Studio Config 47 | ************* 48 | 49 | +-----------------------+-------------------------------------------+ 50 | | Task | Command | 51 | +-----------------------+-------------------------------------------+ 52 | | Build | ``invoke build-config-studio`` | 53 | +-----------------------+-------------------------------------------+ 54 | | Build (Docker) | ``invoke docker-run-build-config-studio`` | 55 | +-----------------------+-------------------------------------------+ 56 | | Updating Mapping File | ``invoke update-mapping-file-studio`` | 57 | +-----------------------+-------------------------------------------+ 58 | -------------------------------------------------------------------------------- /docs/user-guide.rst: -------------------------------------------------------------------------------- 1 | User Guide 2 | ========== 3 | 4 | The user guide provides an overview of **OpenColorIO Configuration for ACES** 5 | and explains important concepts and features, details can be found in the 6 | `API Reference `__. 7 | 8 | .. toctree:: 9 | :maxdepth: 1 10 | 11 | Installation 12 | usage 13 | process 14 | -------------------------------------------------------------------------------- /opencolorio_config_aces/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | OpenColorIO Configuration for ACES 5 | ================================== 6 | 7 | The `OpenColorIO Configuration for ACES \ 8 | `__ is 9 | an open-source `Python `__ package implementing 10 | support for the generation of the *OCIO* configuration for the 11 | *Academy Color Encoding System* (ACES). 12 | 13 | It is freely available under the 14 | `New BSD License `__ terms. 15 | 16 | Sub-packages 17 | ------------ 18 | - clf: Objects implementing support for *CLF* transforms generation. 19 | - config: Objects implementing support for the *OCIO* config generation. 20 | - utilities: Various utilities and data structures. 21 | """ 22 | 23 | from .config import ( 24 | TRANSFORM_FACTORIES, 25 | colorspace_factory, 26 | group_transform_factory, 27 | look_factory, 28 | named_transform_factory, 29 | produce_transform, 30 | transform_factory, 31 | view_transform_factory, 32 | ) 33 | from .config import ( 34 | BUILTIN_TRANSFORMS, 35 | BUILD_CONFIGURATIONS, 36 | BUILD_VARIANT_FILTERERS, 37 | ConfigData, 38 | PROFILE_VERSION_DEFAULT, 39 | PROFILE_VERSIONS, 40 | BuildConfiguration, 41 | deserialize_config_data, 42 | generate_config, 43 | serialize_config_data, 44 | validate_config, 45 | ) 46 | from .config import ( 47 | build_aces_conversion_graph, 48 | classify_aces_ctl_transforms, 49 | conversion_path, 50 | ctl_transform_to_node, 51 | discover_aces_ctl_transforms, 52 | filter_ctl_transforms, 53 | filter_nodes, 54 | generate_amf_components, 55 | node_to_ctl_transform, 56 | plot_aces_conversion_graph, 57 | print_aces_taxonomy, 58 | unclassify_ctl_transforms, 59 | version_aces_dev, 60 | ) 61 | from .config import ( 62 | DescriptionStyle, 63 | generate_config_aces, 64 | ) 65 | from .config import generate_config_cg, generate_config_studio 66 | from .clf import ( 67 | discover_clf_transforms, 68 | classify_clf_transforms, 69 | unclassify_clf_transforms, 70 | filter_clf_transforms, 71 | print_clf_taxonomy, 72 | ) 73 | from .clf import generate_clf_transform 74 | 75 | __author__ = "OpenColorIO Contributors" 76 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 77 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 78 | __maintainer__ = "OpenColorIO Contributors" 79 | __email__ = "ocio-dev@lists.aswf.io" 80 | __status__ = "Production" 81 | 82 | __all__ = [ 83 | "TRANSFORM_FACTORIES", 84 | "colorspace_factory", 85 | "group_transform_factory", 86 | "look_factory", 87 | "named_transform_factory", 88 | "produce_transform", 89 | "transform_factory", 90 | "view_transform_factory", 91 | ] 92 | __all__ += [ 93 | "BUILTIN_TRANSFORMS", 94 | "BUILD_CONFIGURATIONS", 95 | "BUILD_VARIANT_FILTERERS", 96 | "ConfigData", 97 | "PROFILE_VERSION_DEFAULT", 98 | "PROFILE_VERSIONS", 99 | "BuildConfiguration", 100 | "deserialize_config_data", 101 | "generate_config", 102 | "serialize_config_data", 103 | "validate_config", 104 | ] 105 | __all__ += [ 106 | "build_aces_conversion_graph", 107 | "classify_aces_ctl_transforms", 108 | "conversion_path", 109 | "ctl_transform_to_node", 110 | "discover_aces_ctl_transforms", 111 | "filter_ctl_transforms", 112 | "filter_nodes", 113 | "generate_amf_components", 114 | "node_to_ctl_transform", 115 | "plot_aces_conversion_graph", 116 | "print_aces_taxonomy", 117 | "unclassify_ctl_transforms", 118 | "version_aces_dev", 119 | ] 120 | __all__ += [ 121 | "DescriptionStyle", 122 | "generate_config_aces", 123 | ] 124 | __all__ += ["generate_config_cg", "generate_config_studio"] 125 | __all__ += [ 126 | "discover_clf_transforms", 127 | "classify_clf_transforms", 128 | "unclassify_clf_transforms", 129 | "filter_clf_transforms", 130 | "print_clf_taxonomy", 131 | ] 132 | __all__ += ["generate_clf_transform"] 133 | 134 | __application_name__ = "OpenColorIO Configuration for ACES" 135 | 136 | __major_version__ = "3" 137 | __minor_version__ = "0" 138 | __patch_version__ = "0" 139 | __version__ = f"{__major_version__}.{__minor_version__}.{__patch_version__}" 140 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .discover import ( 5 | discover_clf_transforms, 6 | classify_clf_transforms, 7 | unclassify_clf_transforms, 8 | filter_clf_transforms, 9 | print_clf_taxonomy, 10 | ) 11 | from .transforms import ( 12 | generate_clf_transform, 13 | generate_clf_transforms_arri, 14 | generate_clf_transforms_bmdfilm, 15 | generate_clf_transforms_canon, 16 | generate_clf_transforms_davinci, 17 | generate_clf_transforms_itu, 18 | generate_clf_transforms_ocio, 19 | generate_clf_transforms_panasonic, 20 | generate_clf_transforms_red, 21 | generate_clf_transforms_sony, 22 | ) 23 | 24 | __all__ = [ 25 | "discover_clf_transforms", 26 | "classify_clf_transforms", 27 | "unclassify_clf_transforms", 28 | "filter_clf_transforms", 29 | "print_clf_taxonomy", 30 | ] 31 | __all__ += [ 32 | "generate_clf_transform", 33 | "generate_clf_transform", 34 | "generate_clf_transforms_arri", 35 | "generate_clf_transforms_bmdfilm", 36 | "generate_clf_transforms_canon", 37 | "generate_clf_transforms_davinci", 38 | "generate_clf_transforms_itu", 39 | "generate_clf_transforms_ocio", 40 | "generate_clf_transforms_panasonic", 41 | "generate_clf_transforms_red", 42 | "generate_clf_transforms_sony", 43 | ] 44 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/discover/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .classify import ( 5 | discover_clf_transforms, 6 | classify_clf_transforms, 7 | unclassify_clf_transforms, 8 | filter_clf_transforms, 9 | print_clf_taxonomy, 10 | ) 11 | 12 | __all__ = [ 13 | "discover_clf_transforms", 14 | "classify_clf_transforms", 15 | "unclassify_clf_transforms", 16 | "filter_clf_transforms", 17 | "print_clf_taxonomy", 18 | ] 19 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .utilities import ( 5 | matrix_transform, 6 | matrix_RGB_to_RGB_transform, 7 | gamma_transform, 8 | generate_clf_transform, 9 | format_clf_transform_id, 10 | clf_basename, 11 | ) 12 | from .arri import ( 13 | generate_clf_transforms_arri, 14 | ) 15 | from .blackmagic import ( 16 | generate_clf_transforms_bmdfilm, 17 | generate_clf_transforms_davinci, 18 | ) 19 | from .canon import ( 20 | generate_clf_transforms_canon, 21 | ) 22 | from .itu import ( 23 | generate_clf_transforms_itu, 24 | ) 25 | from .ocio import ( 26 | generate_clf_transforms_ocio, 27 | ) 28 | from .panasonic import ( 29 | generate_clf_transforms_panasonic, 30 | ) 31 | from .red import ( 32 | generate_clf_transforms_red, 33 | ) 34 | from .sony import ( 35 | generate_clf_transforms_sony, 36 | ) 37 | 38 | __all__ = [ 39 | "matrix_transform", 40 | "matrix_RGB_to_RGB_transform", 41 | "gamma_transform", 42 | "generate_clf_transform", 43 | "format_clf_transform_id", 44 | "clf_basename", 45 | ] 46 | __all__ += [ 47 | "generate_clf_transforms_arri", 48 | ] 49 | __all__ += [ 50 | "generate_clf_transforms_bmdfilm", 51 | "generate_clf_transforms_davinci", 52 | ] 53 | __all__ += [ 54 | "generate_clf_transforms_canon", 55 | ] 56 | __all__ += [ 57 | "generate_clf_transforms_itu", 58 | ] 59 | __all__ += [ 60 | "generate_clf_transforms_ocio", 61 | ] 62 | __all__ += [ 63 | "generate_clf_transforms_panasonic", 64 | ] 65 | __all__ += [ 66 | "generate_clf_transforms_red", 67 | ] 68 | __all__ += [ 69 | "generate_clf_transforms_sony", 70 | ] 71 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/apple/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .generate import generate_clf_transforms_apple 5 | 6 | __all__ = [ 7 | "generate_clf_transforms_apple", 8 | ] 9 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/apple/generate.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | *Apple* CLF Transforms Generation 5 | ================================= 6 | 7 | Defines procedures for generating Apple *Common LUT Format* (CLF) 8 | transforms: 9 | 10 | - :func:`opencolorio_config_aces.clf.generate_clf_transforms_apple` 11 | """ 12 | 13 | from pathlib import Path 14 | 15 | from opencolorio_config_aces.clf.transforms import ( 16 | clf_basename, 17 | format_clf_transform_id, 18 | generate_clf_transform, 19 | ) 20 | 21 | __author__ = "OpenColorIO Contributors" 22 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 23 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 24 | __maintainer__ = "OpenColorIO Contributors" 25 | __email__ = "ocio-dev@lists.aswf.io" 26 | __status__ = "Production" 27 | 28 | __all__ = [ 29 | "FAMILY", 30 | "GENUS", 31 | "VERSION", 32 | "generate_clf_transforms_apple", 33 | ] 34 | 35 | FAMILY = "Apple" 36 | """ 37 | *CLF* transforms family. 38 | """ 39 | 40 | GENUS = "Input" 41 | """ 42 | *CLF* transforms genus. 43 | """ 44 | 45 | VERSION = "1.0" 46 | """ 47 | *CLF* transforms version. 48 | """ 49 | 50 | 51 | def generate_clf_transforms_apple(output_directory): 52 | """ 53 | Make the CLF file for Apple Log and for Apple Log curve CLF. 54 | 55 | Returns 56 | ------- 57 | dict 58 | Dictionary of *CLF* transforms and *OpenColorIO* `GroupTransform` 59 | instances. 60 | 61 | References 62 | ---------- 63 | - Apple. (September 22, 2023). Apple Log Profile. 64 | Retrieved February 2, 2024, from 65 | https://developer.apple.com/download/all/?q=Apple%20log%20profile 66 | 67 | Notes 68 | ----- 69 | - The resulting *CLF* transforms still need to be reviewed by *Apple*. 70 | """ 71 | 72 | output_directory.mkdir(parents=True, exist_ok=True) 73 | 74 | clf_transforms = {} 75 | 76 | aces_transform_id = ( 77 | "urn:ampas:aces:transformId:v2.0:CSC.Apple.AppleLog_BT2020_to_ACES.a2.v1" 78 | ) 79 | 80 | name = "Apple_Log_to_ACES2065-1" 81 | input_descriptor = "Apple Log" 82 | output_descriptor = "ACES2065-1" 83 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 84 | filename = output_directory / clf_basename(clf_transform_id) 85 | style = "APPLE_LOG_to_ACES2065-1" 86 | clf_transforms[filename] = generate_clf_transform( 87 | filename, 88 | [{"transform_type": "BuiltinTransform", "style": style}], 89 | clf_transform_id, 90 | f"{input_descriptor} to {output_descriptor}", 91 | input_descriptor, 92 | output_descriptor, 93 | aces_transform_id=aces_transform_id, 94 | style=style, 95 | ) 96 | 97 | # Generate `NamedTransform` for log curve only. 98 | 99 | name = "Apple_Log-Curve_to_Linear" 100 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 101 | input_descriptor = "Apple Log (arbitrary primaries)" 102 | output_descriptor = "Linear (arbitrary primaries)" 103 | filename = output_directory / clf_basename(clf_transform_id) 104 | style = "CURVE - APPLE_LOG_to_LINEAR" 105 | clf_transforms[filename] = generate_clf_transform( 106 | filename, 107 | [{"transform_type": "BuiltinTransform", "style": style}], 108 | clf_transform_id, 109 | f'{input_descriptor.replace(" (arbitrary primaries)", "")} to Linear Curve', 110 | input_descriptor, 111 | output_descriptor, 112 | style=style, 113 | ) 114 | 115 | return clf_transforms 116 | 117 | 118 | if __name__ == "__main__": 119 | import logging 120 | 121 | logging.basicConfig() 122 | logging.getLogger().setLevel(logging.INFO) 123 | 124 | output_directory = Path(__file__).parent.resolve() / "input" 125 | 126 | generate_clf_transforms_apple(output_directory) 127 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/arri/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .generate import generate_clf_transforms_arri 5 | 6 | __all__ = [ 7 | "generate_clf_transforms_arri", 8 | ] 9 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/arri/input/ARRI.Input.ARRI_LogC3_Curve_EI800.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ARRI LogC3 Curve (EI800) 4 | Relative Scene Linear 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/arri/input/ARRI.Input.ARRI_LogC3_EI800_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ARRI LogC3 (EI800) 4 | ACES2065-1 5 | 6 | urn:ampas:aces:transformId:v2.0:CSC.Arri.LogCv3_to_ACES.a2.v1 7 | 8 | 9 | 10 | 11 | 12 | 13 | 0.680205505106279 0.236136601606481 0.0836578932872398 14 | 0.0854149797421404 1.01747087860704 -0.102885858349182 15 | 0.00205652166929683 -0.0625625003847921 1.06050597871549 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/arri/input/ARRI.Input.ARRI_LogC4_Curve.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ARRI LogC4 Curve 4 | Relative Scene Linear 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/arri/input/ARRI.Input.ARRI_LogC4_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ARRI LogC4 4 | ACES2065-1 5 | 6 | urn:ampas:aces:transformId:v2.0:CSC.Arri.LogCv4_to_ACES.a2.v1 7 | 8 | 9 | 10 | 11 | 12 | 13 | 0.750957362824734 0.144422786709757 0.104619850465509 14 | 0.000821837079380207 1.007397584885 -0.00821942196438358 15 | -0.000499952143533471 -0.000854177231436971 1.00135412937497 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/arri/input/ARRI.Input.Linear_ARRI_Wide_Gamut_3_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Linear ARRI Wide Gamut 3 4 | ACES2065-1 5 | 6 | 7 | 0.680205505106279 0.236136601606481 0.0836578932872398 8 | 0.0854149797421404 1.01747087860704 -0.102885858349182 9 | 0.00205652166929683 -0.0625625003847921 1.06050597871549 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/arri/input/ARRI.Input.Linear_ARRI_Wide_Gamut_4_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Linear ARRI Wide Gamut 4 4 | ACES2065-1 5 | 6 | 7 | 0.750957362824734 0.144422786709757 0.104619850465509 8 | 0.000821837079380207 1.007397584885 -0.00821942196438358 9 | -0.000499952143533471 -0.000854177231436971 1.00135412937497 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/blackmagic/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .generate import ( 5 | generate_clf_transforms_bmdfilm, 6 | generate_clf_transforms_davinci, 7 | ) 8 | 9 | __all__ = [ 10 | "generate_clf_transforms_bmdfilm", 11 | "generate_clf_transforms_davinci", 12 | ] 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/blackmagic/generate.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | *Blackmagic* CLF Transforms Generation 5 | ======================================= 6 | 7 | Defines procedures for generating Blackmagic *Common LUT Format* (CLF) 8 | transforms: 9 | 10 | - :func:`opencolorio_config_aces.clf.generate_clf_transforms_bmdfilm` 11 | - :func:`opencolorio_config_aces.clf.generate_clf_transforms_davinci` 12 | """ 13 | 14 | import math 15 | from pathlib import Path 16 | 17 | import PyOpenColorIO as ocio 18 | 19 | from opencolorio_config_aces.clf.transforms import ( 20 | clf_basename, 21 | format_clf_transform_id, 22 | generate_clf_transform, 23 | matrix_RGB_to_RGB_transform, 24 | ) 25 | from opencolorio_config_aces.config import transform_factory 26 | 27 | __author__ = "OpenColorIO Contributors" 28 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 29 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 30 | __maintainer__ = "OpenColorIO Contributors" 31 | __email__ = "ocio-dev@lists.aswf.io" 32 | __status__ = "Production" 33 | 34 | __all__ = [ 35 | "FAMILY", 36 | "GENUS", 37 | "VERSION", 38 | "generate_clf_transforms_bmdfilm", 39 | "generate_clf_transforms_davinci", 40 | ] 41 | 42 | FAMILY = "BlackmagicDesign" 43 | """ 44 | *CLF* transforms family. 45 | """ 46 | 47 | GENUS = "Input" 48 | """ 49 | *CLF* transforms genus. 50 | """ 51 | 52 | VERSION = "1.0" 53 | """ 54 | *CLF* transforms version. 55 | """ 56 | 57 | 58 | def generate_clf_transforms_bmdfilm(output_directory): 59 | """ 60 | Make the CLF file for BMDFilm_WideGamut_Gen5 plus matrix/curve CLFs. 61 | 62 | Returns 63 | ------- 64 | dict 65 | Dictionary of *CLF* transforms and *OpenColorIO* `GroupTransform` 66 | instances. 67 | 68 | References 69 | ---------- 70 | - Blackmagic Design. (2021). Blackmagic Generation 5 Color Science. 71 | 72 | Notes 73 | ----- 74 | - The resulting *CLF* transforms were reviewed by *Blackmagic*. 75 | """ 76 | 77 | output_directory.mkdir(parents=True, exist_ok=True) 78 | 79 | clf_transforms = {} 80 | 81 | cut = 0.005 82 | a = 0.08692876065491224 83 | b = 0.005494072432257808 84 | c = 0.5300133392291939 85 | # d = 8.283605932402494 86 | # e = 0.09246575342465753 87 | 88 | BASE = math.e 89 | LIN_SB = cut 90 | LOG_SLP = a 91 | LOG_OFF = c 92 | LIN_SLP = 1.0 93 | LIN_OFF = b 94 | 95 | # It is not necessary to set the linear_slope value in the LogCameraTransform 96 | # since the values automatically calculated by OCIO match the published values 97 | # to within double precision. This may be verified using the following formulas: 98 | # LINEAR_SLOPE = 99 | # LOG_SLP * LIN_SLP / ( (LIN_SLP * LIN_SB + LIN_OFF) * math.log(BASE) ) 100 | # LOG_SB = LOG_SLP * math.log(LIN_SLP * LIN_SB + LIN_OFF) + LOG_OFF 101 | # LINEAR_OFFSET = LOG_SB - LINEAR_SLOPE * LIN_SB 102 | # print(LINEAR_SLOPE, LINEAR_OFFSET) 103 | # This prints 8.283605932402494 0.09246575342465779, which is sufficiently close 104 | # to the specified d and e above. 105 | 106 | lct = transform_factory( 107 | transform_type="LogCameraTransform", 108 | transform_factory="Constructor", 109 | base=BASE, 110 | linSideBreak=[LIN_SB] * 3, 111 | logSideSlope=[LOG_SLP] * 3, 112 | logSideOffset=[LOG_OFF] * 3, 113 | linSideSlope=[LIN_SLP] * 3, 114 | linSideOffset=[LIN_OFF] * 3, 115 | direction=ocio.TRANSFORM_DIR_INVERSE, 116 | ) 117 | 118 | mtx = matrix_RGB_to_RGB_transform("Blackmagic Wide Gamut", "ACES2065-1", "CAT02") 119 | 120 | # Taking the color space name and IDT transform ID from: 121 | # https://github.com/ampas/aces-dev/pull/126/files 122 | aces_transform_id = ( 123 | "urn:ampas:aces:transformId:v1.5:" 124 | "IDT.BlackmagicDesign.BMDFilm_WideGamut_Gen5.a1.v1" 125 | ) 126 | 127 | # Generate full transform. 128 | 129 | name = "BMDFilm_WideGamut_Gen5_to_ACES2065-1" 130 | input_descriptor = "Blackmagic Film Wide Gamut (Gen 5)" 131 | output_descriptor = "ACES2065-1" 132 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 133 | filename = output_directory / clf_basename(clf_transform_id) 134 | clf_transforms[filename] = generate_clf_transform( 135 | filename, 136 | [lct, mtx], 137 | clf_transform_id, 138 | f"{input_descriptor} to {output_descriptor}", 139 | input_descriptor, 140 | output_descriptor, 141 | aces_transform_id, 142 | ) 143 | 144 | # Generate transform for primaries only. 145 | 146 | name = "Linear_BMD_WideGamut_Gen5_to_ACES2065-1" 147 | input_descriptor = "Linear Blackmagic Wide Gamut (Gen 5)" 148 | output_descriptor = "ACES2065-1" 149 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 150 | filename = output_directory / clf_basename(clf_transform_id) 151 | clf_transforms[filename] = generate_clf_transform( 152 | filename, 153 | [mtx], 154 | clf_transform_id, 155 | f"{input_descriptor} to {output_descriptor}", 156 | input_descriptor, 157 | output_descriptor, 158 | ) 159 | 160 | # Generate `NamedTransform` for log curve only. 161 | 162 | name = "BMDFilm_Gen5_Log-Curve_to_Linear" 163 | input_descriptor = "Blackmagic Film (Gen 5) Log" 164 | output_descriptor = "Blackmagic Film (Gen 5) Linear" 165 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 166 | filename = output_directory / clf_basename(clf_transform_id) 167 | clf_transforms[filename] = generate_clf_transform( 168 | filename, 169 | [lct], 170 | clf_transform_id, 171 | f"{input_descriptor} to Linear Curve", 172 | input_descriptor, 173 | output_descriptor, 174 | ) 175 | 176 | return clf_transforms 177 | 178 | 179 | def generate_clf_transforms_davinci(output_directory): 180 | """ 181 | Make the CLF file for DaVinci Intermediate Wide Gamut plus matrix/curve CLFs. 182 | 183 | Returns 184 | ------- 185 | dict 186 | Dictionary of *CLF* transforms and *OpenColorIO* `GroupTransform` 187 | instances. 188 | 189 | References 190 | ---------- 191 | - Blackmagic Design. (2020). Wide Gamut Intermediate DaVinci Resolve. 192 | Retrieved December 12, 2020, from 193 | https://documents.blackmagicdesign.com/InformationNotes/\ 194 | DaVinci_Resolve_17_Wide_Gamut_Intermediate.pdf?_v=1607414410000 195 | 196 | Notes 197 | ----- 198 | - The resulting *CLF* transforms were reviewed by *Blackmagic*. 199 | """ 200 | 201 | output_directory.mkdir(parents=True, exist_ok=True) 202 | 203 | clf_transforms = {} 204 | 205 | cut = 0.00262409 206 | a = 0.0075 207 | b = 7.0 208 | c = 0.07329248 209 | m = 10.44426855 210 | 211 | BASE = 2.0 212 | LIN_SB = cut 213 | LOG_SLP = c 214 | LOG_OFF = c * b 215 | LIN_SLP = 1.0 216 | LIN_OFF = a 217 | 218 | # The linear slope that would be calculated by OCIO based on continuity of the 219 | # derivatives is 10.444266836 vs. the published value of 10.44426855. Based on 220 | # input from Blackmagic, it is preferable to set the linear slope value explicitly. 221 | LINEAR_SLOPE = m 222 | 223 | lct = transform_factory( 224 | transform_type="LogCameraTransform", 225 | transform_factory="Constructor", 226 | base=BASE, 227 | linSideBreak=[LIN_SB] * 3, 228 | logSideSlope=[LOG_SLP] * 3, 229 | logSideOffset=[LOG_OFF] * 3, 230 | linSideSlope=[LIN_SLP] * 3, 231 | linSideOffset=[LIN_OFF] * 3, 232 | linearSlope=[LINEAR_SLOPE] * 3, 233 | direction=ocio.TRANSFORM_DIR_INVERSE, 234 | ) 235 | 236 | mtx = matrix_RGB_to_RGB_transform("DaVinci Wide Gamut", "ACES2065-1", "CAT02") 237 | 238 | # This transform is not yet part of aces-dev, but an ID will be needed for AMF. 239 | # Proposing the following ID: 240 | aces_transform_id = ( 241 | "urn:ampas:aces:transformId:v2.0:" 242 | "CSC.Blackmagic.DaVinci_Intermediate_WideGamut_to_ACES.a2.v1" 243 | ) 244 | 245 | # Generate full transform. 246 | 247 | name = "DaVinci_Intermediate_WideGamut_to_ACES2065-1" 248 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 249 | input_descriptor = "DaVinci Intermediate Wide Gamut" 250 | output_descriptor = "ACES2065-1" 251 | filename = output_directory / clf_basename(clf_transform_id) 252 | clf_transforms[filename] = generate_clf_transform( 253 | filename, 254 | [lct, mtx], 255 | clf_transform_id, 256 | f"{input_descriptor} to {output_descriptor}", 257 | input_descriptor, 258 | output_descriptor, 259 | aces_transform_id, 260 | ) 261 | 262 | # Generate transform for primaries only. 263 | 264 | name = "Linear_DaVinci_WideGamut_to_ACES2065-1" 265 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 266 | input_descriptor = "Linear DaVinci Wide Gamut" 267 | output_descriptor = "ACES2065-1" 268 | filename = output_directory / clf_basename(clf_transform_id) 269 | clf_transforms[filename] = generate_clf_transform( 270 | filename, 271 | [mtx], 272 | clf_transform_id, 273 | f"{input_descriptor} to {output_descriptor}", 274 | input_descriptor, 275 | output_descriptor, 276 | ) 277 | 278 | # Generate `NamedTransform` for log curve only. 279 | 280 | name = "DaVinci_Intermediate_Log-Curve_to_Linear" 281 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 282 | input_descriptor = "DaVinci Intermediate Log" 283 | output_descriptor = "DaVinci Intermediate Linear" 284 | filename = output_directory / clf_basename(clf_transform_id) 285 | clf_transforms[filename] = generate_clf_transform( 286 | filename, 287 | [lct], 288 | clf_transform_id, 289 | f"{input_descriptor} to Linear Curve", 290 | input_descriptor, 291 | output_descriptor, 292 | ) 293 | 294 | return clf_transforms 295 | 296 | 297 | if __name__ == "__main__": 298 | import logging 299 | 300 | logging.basicConfig() 301 | logging.getLogger().setLevel(logging.INFO) 302 | 303 | output_directory = Path(__file__).parent.resolve() / "input" 304 | 305 | generate_clf_transforms_bmdfilm(output_directory) 306 | generate_clf_transforms_davinci(output_directory) 307 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/blackmagic/input/BlackmagicDesign.Input.BMDFilm_Gen5_Log-Curve.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Blackmagic Film (Gen 5) Log 4 | Blackmagic Film (Gen 5) Linear 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/blackmagic/input/BlackmagicDesign.Input.BMDFilm_WideGamut_Gen5_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Blackmagic Film Wide Gamut (Gen 5) 4 | ACES2065-1 5 | 6 | urn:ampas:aces:transformId:v2.0:CSC.Blackmagic.BMDFilm_WideGamut_Gen5_to_ACES.a2.v1 7 | 8 | 9 | 10 | 11 | 12 | 13 | 0.647091325580708 0.242595385134207 0.110313289285085 14 | 0.0651915997328519 1.02504756760476 -0.0902391673376125 15 | -0.0275570729194699 -0.0805887097177784 1.10814578263725 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/blackmagic/input/BlackmagicDesign.Input.DaVinci_Intermediate_Log-Curve.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | DaVinci Intermediate Log 4 | DaVinci Intermediate Linear 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/blackmagic/input/BlackmagicDesign.Input.DaVinci_Intermediate_WideGamut_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | DaVinci Intermediate Wide Gamut 4 | ACES2065-1 5 | 6 | urn:ampas:aces:transformId:v2.0:CSC.Blackmagic.DaVinci_Intermediate_WideGamut_to_ACES.a2.v1 7 | 8 | 9 | 10 | 11 | 12 | 13 | 0.748270290272981 0.167694659554328 0.0840350501726906 14 | 0.0208421234689102 1.11190474268894 -0.132746866157851 15 | -0.0915122574225729 -0.127746712807307 1.21925897022988 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/blackmagic/input/BlackmagicDesign.Input.Linear_BMD_WideGamut_Gen5_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Linear Blackmagic Wide Gamut (Gen 5) 4 | ACES2065-1 5 | 6 | 7 | 0.647091325580708 0.242595385134207 0.110313289285085 8 | 0.0651915997328519 1.02504756760476 -0.0902391673376125 9 | -0.0275570729194699 -0.0805887097177784 1.10814578263725 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/blackmagic/input/BlackmagicDesign.Input.Linear_DaVinci_WideGamut_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Linear DaVinci Wide Gamut 4 | ACES2065-1 5 | 6 | 7 | 0.748270290272981 0.167694659554328 0.0840350501726906 8 | 0.0208421234689102 1.11190474268894 -0.132746866157851 9 | -0.0915122574225729 -0.127746712807307 1.21925897022988 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/canon/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .generate import ( 5 | generate_clf_transforms_canon, 6 | ) 7 | 8 | __all__ = [ 9 | "generate_clf_transforms_canon", 10 | ] 11 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/canon/generate.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | *Canon* CLF Transforms Generation 5 | ================================= 6 | 7 | Defines procedures for generating Canon *Common LUT Format* (CLF) 8 | transforms: 9 | 10 | - :func:`opencolorio_config_aces.clf.generate_clf_transforms_canon` 11 | """ 12 | 13 | from pathlib import Path 14 | 15 | from opencolorio_config_aces.clf.transforms import ( 16 | clf_basename, 17 | format_clf_transform_id, 18 | generate_clf_transform, 19 | matrix_RGB_to_RGB_transform, 20 | ) 21 | 22 | __author__ = "OpenColorIO Contributors" 23 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 24 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 25 | __maintainer__ = "OpenColorIO Contributors" 26 | __email__ = "ocio-dev@lists.aswf.io" 27 | __status__ = "Production" 28 | 29 | __all__ = [ 30 | "FAMILY", 31 | "GENUS", 32 | "VERSION", 33 | "generate_clf_transforms_canon", 34 | ] 35 | 36 | FAMILY = "Canon" 37 | """ 38 | *CLF* transforms family. 39 | """ 40 | 41 | GENUS = "Input" 42 | """ 43 | *CLF* transforms genus. 44 | """ 45 | 46 | VERSION = "1.0" 47 | """ 48 | *CLF* transforms version. 49 | """ 50 | 51 | 52 | def generate_clf_transforms_canon(output_directory): 53 | """ 54 | Make the CLF file for Canon C-Log2 / C-Log3 Cinema Gamut plus matrix/curve 55 | CLFs. 56 | 57 | Returns 58 | ------- 59 | dict 60 | Dictionary of *CLF* transforms and *OpenColorIO* `GroupTransform` 61 | instances. 62 | 63 | References 64 | ---------- 65 | - Canon. (2018). White Paper on Canon Log. 66 | Retrieved September 22, 2022, from http://downloads.canon.com/nw/learn/\ 67 | white-papers/cinema-eos/white-paper-canon-log-gamma-curves.pdf 68 | 69 | Notes 70 | ----- 71 | - The resulting *CLF* transforms were reviewed by *Canon*. 72 | """ 73 | 74 | output_directory.mkdir(parents=True, exist_ok=True) 75 | 76 | clf_transforms = {} 77 | 78 | mtx = matrix_RGB_to_RGB_transform("Cinema Gamut", "ACES2065-1", "CAT02") 79 | 80 | aces_transform_id = ( 81 | "urn:ampas:aces:transformId:v2.0:CSC.Canon.CLog2_CGamut_to_ACES.a1.v1" 82 | ) 83 | 84 | name = "CanonLog2_CinemaGamut-D55_to_ACES2065-1" 85 | input_descriptor = "Canon Log 2 Cinema Gamut (Daylight)" 86 | output_descriptor = "ACES2065-1" 87 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 88 | filename = output_directory / clf_basename(clf_transform_id) 89 | style = "CANON_CLOG2-CGAMUT_to_ACES2065-1" 90 | clf_transforms[filename] = generate_clf_transform( 91 | filename, 92 | [{"transform_type": "BuiltinTransform", "style": style}], 93 | clf_transform_id, 94 | f"{input_descriptor} to {output_descriptor}", 95 | input_descriptor, 96 | output_descriptor, 97 | aces_transform_id, 98 | style=style, 99 | ) 100 | 101 | aces_transform_id = ( 102 | "urn:ampas:aces:transformId:v2.0:CSC.Canon.CLog3_CGamut_to_ACES.a1.v1" 103 | ) 104 | 105 | name = "CanonLog3_CinemaGamut-D55_to_ACES2065-1" 106 | input_descriptor = "Canon Log 3 Cinema Gamut (Daylight)" 107 | output_descriptor = "ACES2065-1" 108 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 109 | filename = output_directory / clf_basename(clf_transform_id) 110 | style = "CANON_CLOG3-CGAMUT_to_ACES2065-1" 111 | clf_transforms[filename] = generate_clf_transform( 112 | filename, 113 | [{"transform_type": "BuiltinTransform", "style": style}], 114 | clf_transform_id, 115 | f"{input_descriptor} to {output_descriptor}", 116 | input_descriptor, 117 | output_descriptor, 118 | aces_transform_id, 119 | style=style, 120 | ) 121 | 122 | # Generate transform for primaries only. 123 | 124 | name = "Linear-CinemaGamut-D55_to_ACES2065-1" 125 | input_descriptor = "Linear Canon Cinema Gamut (Daylight)" 126 | output_descriptor = "ACES2065-1" 127 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 128 | filename = output_directory / clf_basename(clf_transform_id) 129 | clf_transforms[filename] = generate_clf_transform( 130 | filename, 131 | [mtx], 132 | clf_transform_id, 133 | f"{input_descriptor} to {output_descriptor}", 134 | input_descriptor, 135 | output_descriptor, 136 | ) 137 | 138 | # Generate `NamedTransform` for log curve only. 139 | 140 | name = "CLog2-Curve_to_Linear" 141 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 142 | input_descriptor = "CLog2 Log (arbitrary primaries)" 143 | output_descriptor = "CLog2 Linear (arbitrary primaries)" 144 | filename = output_directory / clf_basename(clf_transform_id) 145 | style = "CURVE - CANON_CLOG2_to_LINEAR" 146 | clf_transforms[filename] = generate_clf_transform( 147 | filename, 148 | [{"transform_type": "BuiltinTransform", "style": style}], 149 | clf_transform_id, 150 | f'{input_descriptor.replace(" (arbitrary primaries)", "")} to Linear Curve', 151 | input_descriptor, 152 | output_descriptor, 153 | style=style, 154 | ) 155 | 156 | name = "CLog3-Curve_to_Linear" 157 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 158 | input_descriptor = "CLog3 Log (arbitrary primaries)" 159 | output_descriptor = "CLog3 Linear (arbitrary primaries)" 160 | filename = output_directory / clf_basename(clf_transform_id) 161 | style = "CURVE - CANON_CLOG3_to_LINEAR" 162 | clf_transforms[filename] = generate_clf_transform( 163 | filename, 164 | [{"transform_type": "BuiltinTransform", "style": style}], 165 | clf_transform_id, 166 | f'{input_descriptor.replace(" (arbitrary primaries)", "")} to Linear Curve', 167 | input_descriptor, 168 | output_descriptor, 169 | style=style, 170 | ) 171 | 172 | return clf_transforms 173 | 174 | 175 | if __name__ == "__main__": 176 | import logging 177 | 178 | logging.basicConfig() 179 | logging.getLogger().setLevel(logging.INFO) 180 | 181 | output_directory = Path(__file__).parent.resolve() / "input" 182 | 183 | generate_clf_transforms_canon(output_directory) 184 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/canon/input/Canon.Input.Linear-CinemaGamut-D55_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Linear Canon Cinema Gamut (Daylight) 4 | ACES2065-1 5 | 6 | 7 | 0.763064454775734 0.14902116113706 0.0879143840872056 8 | 0.00365745670512393 1.10696038037622 -0.110617837081339 9 | -0.0094077940457189 -0.218383304989987 1.22779109903571 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/itu/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .generate import ( 5 | generate_clf_transforms_itu, 6 | ) 7 | 8 | __all__ = [ 9 | "generate_clf_transforms_itu", 10 | ] 11 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/itu/generate.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | *ITU-R* CLF Transforms Generation 5 | ================================= 6 | 7 | Defines procedures for generating specific *Common LUT Format* (CLF) 8 | transforms: 9 | 10 | - :func:`opencolorio_config_aces.clf.generate_clf_transforms_itu` 11 | """ 12 | 13 | from pathlib import Path 14 | 15 | from opencolorio_config_aces.clf.transforms import ( 16 | clf_basename, 17 | format_clf_transform_id, 18 | gamma_transform, 19 | generate_clf_transform, 20 | matrix_RGB_to_RGB_transform, 21 | ) 22 | 23 | __author__ = "OpenColorIO Contributors" 24 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 25 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 26 | __maintainer__ = "OpenColorIO Contributors" 27 | __email__ = "ocio-dev@lists.aswf.io" 28 | __status__ = "Production" 29 | 30 | __all__ = [ 31 | "FAMILY", 32 | "GENUS", 33 | "VERSION", 34 | "generate_clf_transforms_itu", 35 | ] 36 | 37 | FAMILY = "ITU" 38 | """ 39 | *CLF* transforms family. 40 | """ 41 | 42 | GENUS = "Utility" 43 | """ 44 | *CLF* transforms genus. 45 | """ 46 | 47 | VERSION = "1.0" 48 | """ 49 | *CLF* transforms version. 50 | """ 51 | 52 | 53 | def generate_clf_transforms_itu(output_directory): 54 | """Generate OCIO Utility CLF transforms.""" 55 | 56 | output_directory.mkdir(parents=True, exist_ok=True) 57 | 58 | clf_transforms = {} 59 | 60 | name = "AP0_to_Camera_Rec709" 61 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 62 | filename = output_directory / clf_basename(clf_transform_id) 63 | clf_transforms[filename] = generate_clf_transform( 64 | filename, 65 | [ 66 | matrix_RGB_to_RGB_transform("ACES2065-1", "ITU-R BT.709"), 67 | gamma_transform("Rec709"), 68 | ], 69 | clf_transform_id, 70 | "AP0 to Camera Rec.709", 71 | "ACES2065-1", 72 | "Rec.709 camera OETF Rec.709 primaries, D65 white point", 73 | ) 74 | 75 | name = "Linear_to_Rec709-Curve" 76 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 77 | filename = output_directory / clf_basename(clf_transform_id) 78 | clf_transforms[filename] = generate_clf_transform( 79 | filename, 80 | [gamma_transform("Rec709")], 81 | clf_transform_id, 82 | "Linear to Rec.709", 83 | "generic linear RGB", 84 | "generic gamma-corrected RGB", 85 | ) 86 | 87 | return clf_transforms 88 | 89 | 90 | if __name__ == "__main__": 91 | import logging 92 | 93 | logging.basicConfig() 94 | logging.getLogger().setLevel(logging.INFO) 95 | 96 | output_directory = Path(__file__).parent.resolve() 97 | 98 | generate_clf_transforms_itu(output_directory / "utility") 99 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/itu/utility/ITU.Utility.AP0_to_Camera_Rec709.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ACES2065-1 4 | Rec.709 camera OETF Rec.709 primaries, D65 white point 5 | 6 | 7 | 2.52168618674388 -1.13413098823972 -0.387555198504164 8 | -0.276479914229922 1.37271908766826 -0.096239173438334 9 | -0.0153780649660342 -0.152975335867399 1.16835340083343 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/itu/utility/ITU.Utility.Rec709-Curve.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | generic linear RGB 4 | generic gamma-corrected RGB 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .generate import ( 5 | generate_clf_transforms_ocio, 6 | ) 7 | 8 | __all__ = [ 9 | "generate_clf_transforms_ocio", 10 | ] 11 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/generate.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | *OpenColorIO* CLF Transforms Generation 5 | ======================================= 6 | 7 | Defines procedures for generating specific *Common LUT Format* (CLF) 8 | transforms: 9 | 10 | - :func:`opencolorio_config_aces.clf.generate_clf_transforms_ocio` 11 | """ 12 | 13 | from pathlib import Path 14 | 15 | from opencolorio_config_aces.clf.transforms import ( 16 | clf_basename, 17 | format_clf_transform_id, 18 | gamma_transform, 19 | generate_clf_transform, 20 | matrix_RGB_to_RGB_transform, 21 | matrix_transform, 22 | ) 23 | from opencolorio_config_aces.utilities import required 24 | 25 | __author__ = "OpenColorIO Contributors" 26 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 27 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 28 | __maintainer__ = "OpenColorIO Contributors" 29 | __email__ = "ocio-dev@lists.aswf.io" 30 | __status__ = "Production" 31 | 32 | __all__ = [ 33 | "FAMILY", 34 | "GENUS", 35 | "VERSION", 36 | "generate_clf_transforms_ocio", 37 | ] 38 | 39 | FAMILY = "OCIO" 40 | """ 41 | *CLF* transforms family. 42 | """ 43 | 44 | GENUS = "Utility" 45 | """ 46 | *CLF* transforms genus. 47 | """ 48 | 49 | VERSION = "1.0" 50 | """ 51 | *CLF* transforms version. 52 | """ 53 | 54 | 55 | @required("Colour") 56 | def generate_clf_transforms_ocio(output_directory): 57 | """Generate OCIO Utility CLF transforms.""" 58 | 59 | import colour 60 | 61 | output_directory.mkdir(parents=True, exist_ok=True) 62 | 63 | clf_transforms = {} 64 | 65 | name = "Linear_to_Rec1886-Curve" 66 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 67 | filename = output_directory / clf_basename(clf_transform_id) 68 | clf_transforms[filename] = generate_clf_transform( 69 | filename, 70 | [gamma_transform(2.4)], 71 | clf_transform_id, 72 | "Linear to Rec.1886", 73 | "generic linear RGB", 74 | "Rec.1886 encoded RGB", 75 | ) 76 | 77 | name = "Linear_to_sRGB-Curve" 78 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 79 | filename = output_directory / clf_basename(clf_transform_id) 80 | clf_transforms[filename] = generate_clf_transform( 81 | filename, 82 | [gamma_transform("sRGB")], 83 | clf_transform_id, 84 | "Linear to sRGB", 85 | "generic linear RGB", 86 | "sRGB encoded RGB", 87 | ) 88 | 89 | name = "Linear_to_ST2084-Curve" 90 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 91 | filename = output_directory / clf_basename(clf_transform_id) 92 | style = "CURVE - LINEAR_to_ST-2084" 93 | clf_transforms[filename] = generate_clf_transform( 94 | filename, 95 | [{"transform_type": "BuiltinTransform", "style": style}], 96 | clf_transform_id, 97 | "Linear to ST.2084", 98 | "generic linear RGB", 99 | "generic ST.2084 (PQ) encoded RGB mapping 1.0 to 100nits", 100 | style=style, 101 | ) 102 | 103 | name = "AP0_to_CIE_XYZ-D65-Scene-referred" 104 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 105 | filename = output_directory / clf_basename(clf_transform_id) 106 | M_ACES = colour.RGB_COLOURSPACES["ACES2065-1"].matrix_RGB_to_XYZ 107 | XYZ_ACES = colour.xy_to_XYZ(colour.RGB_COLOURSPACES["ACES2065-1"].whitepoint) 108 | XYZ_D65 = colour.xy_to_XYZ( 109 | colour.CCS_ILLUMINANTS["CIE 1931 2 Degree Standard Observer"]["D65"] 110 | ) 111 | M_XYZ = colour.algebra.matrix_dot( 112 | colour.adaptation.matrix_chromatic_adaptation_VonKries( 113 | XYZ_ACES, XYZ_D65, "Bradford" 114 | ), 115 | M_ACES, 116 | ) 117 | clf_transforms[filename] = generate_clf_transform( 118 | filename, 119 | [matrix_transform(M_XYZ)], 120 | clf_transform_id, 121 | "AP0 to CIE XYZ-D65", 122 | "ACES2065-1", 123 | "CIE XYZ, D65 white point", 124 | ) 125 | 126 | name = "AP0_to_Linear_P3-D65" 127 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 128 | filename = output_directory / clf_basename(clf_transform_id) 129 | clf_transforms[filename] = generate_clf_transform( 130 | filename, 131 | [matrix_RGB_to_RGB_transform("ACES2065-1", "P3-D65")], 132 | clf_transform_id, 133 | "AP0 to Linear P3-D65", 134 | "ACES2065-1", 135 | "linear P3 primaries, D65 white point", 136 | ) 137 | 138 | name = "AP0_to_Linear_Rec2020" 139 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 140 | filename = output_directory / clf_basename(clf_transform_id) 141 | clf_transforms[filename] = generate_clf_transform( 142 | filename, 143 | [matrix_RGB_to_RGB_transform("ACES2065-1", "ITU-R BT.2020")], 144 | clf_transform_id, 145 | "AP0 to Linear Rec.2020", 146 | "ACES2065-1", 147 | "linear Rec.2020 primaries, D65 white point", 148 | ) 149 | 150 | name = "AP0_to_Linear_Rec709" 151 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 152 | filename = output_directory / clf_basename(clf_transform_id) 153 | clf_transforms[filename] = generate_clf_transform( 154 | filename, 155 | [matrix_RGB_to_RGB_transform("ACES2065-1", "ITU-R BT.709")], 156 | clf_transform_id, 157 | "AP0 to Linear Rec.709 (sRGB)", 158 | "ACES2065-1", 159 | "linear Rec.709 primaries, D65 white point", 160 | ) 161 | 162 | name = "AP0_to_Linear_AdobeRGB" 163 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 164 | filename = output_directory / clf_basename(clf_transform_id) 165 | clf_transforms[filename] = generate_clf_transform( 166 | filename, 167 | [matrix_RGB_to_RGB_transform("ACES2065-1", "Adobe RGB (1998)")], 168 | clf_transform_id, 169 | "AP0 to Linear Adobe RGB (1998)", 170 | "ACES2065-1", 171 | "linear Adobe RGB (1998) primaries, D65 white point", 172 | ) 173 | 174 | name = "AP0_to_sRGB-Encoded-Rec709" 175 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 176 | filename = output_directory / clf_basename(clf_transform_id) 177 | clf_transforms[filename] = generate_clf_transform( 178 | filename, 179 | [ 180 | matrix_RGB_to_RGB_transform("ACES2065-1", "sRGB"), 181 | gamma_transform("sRGB"), 182 | ], 183 | clf_transform_id, 184 | "AP0 to sRGB Encoded Rec.709 (sRGB)", 185 | "ACES2065-1", 186 | "sRGB", 187 | ) 188 | 189 | name = "AP0_to_Gamma1.8_Encoded_Rec709" 190 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 191 | filename = output_directory / clf_basename(clf_transform_id) 192 | clf_transforms[filename] = generate_clf_transform( 193 | filename, 194 | [ 195 | matrix_RGB_to_RGB_transform("ACES2065-1", "ITU-R BT.709"), 196 | gamma_transform(1.8), 197 | ], 198 | clf_transform_id, 199 | "AP0 to Gamma 1.8 Encoded Rec.709", 200 | "ACES2065-1", 201 | "1.8 gamma-corrected Rec.709 primaries, D65 white point", 202 | ) 203 | 204 | name = "AP0_to_Gamma2.2_Encoded_Rec709" 205 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 206 | filename = output_directory / clf_basename(clf_transform_id) 207 | clf_transforms[filename] = generate_clf_transform( 208 | filename, 209 | [ 210 | matrix_RGB_to_RGB_transform("ACES2065-1", "ITU-R BT.709"), 211 | gamma_transform(2.2), 212 | ], 213 | clf_transform_id, 214 | "AP0 to Gamma 2.2 Encoded Rec.709", 215 | "ACES2065-1", 216 | "2.2 gamma-corrected Rec.709 primaries, D65 white point", 217 | ) 218 | 219 | name = "AP0_to_Gamma2.4_Encoded_Rec709" 220 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 221 | filename = output_directory / clf_basename(clf_transform_id) 222 | clf_transforms[filename] = generate_clf_transform( 223 | filename, 224 | [ 225 | matrix_RGB_to_RGB_transform("ACES2065-1", "ITU-R BT.709"), 226 | gamma_transform(2.4), 227 | ], 228 | clf_transform_id, 229 | "AP0 to Gamma 2.4 Encoded Rec.709", 230 | "ACES2065-1", 231 | "2.4 gamma-corrected Rec.709 primaries, D65 white point", 232 | ) 233 | 234 | name = "AP0_to_Gamma2.2_Encoded_AP1" 235 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 236 | filename = output_directory / clf_basename(clf_transform_id) 237 | clf_transforms[filename] = generate_clf_transform( 238 | filename, 239 | [ 240 | matrix_RGB_to_RGB_transform("ACES2065-1", "ACEScg"), 241 | gamma_transform(2.2), 242 | ], 243 | clf_transform_id, 244 | "AP0 to Gamma 2.2 Encoded AP1", 245 | "ACES2065-1", 246 | "2.2 gamma-corrected AP1 primaries, ACES ~=D60 white point", 247 | ) 248 | 249 | name = "AP0_to_sRGB_Encoded_AP1" 250 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 251 | filename = output_directory / clf_basename(clf_transform_id) 252 | clf_transforms[filename] = generate_clf_transform( 253 | filename, 254 | [ 255 | matrix_RGB_to_RGB_transform("ACES2065-1", "ACEScg"), 256 | gamma_transform("sRGB"), 257 | ], 258 | clf_transform_id, 259 | "AP0 to sRGB Encoded AP1", 260 | "ACES2065-1", 261 | "sRGB Encoded AP1 primaries, ACES ~=D60 white point", 262 | ) 263 | 264 | name = "AP0_to_sRGB_Encoded_P3-D65" 265 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 266 | filename = output_directory / clf_basename(clf_transform_id) 267 | clf_transforms[filename] = generate_clf_transform( 268 | filename, 269 | [ 270 | matrix_RGB_to_RGB_transform("ACES2065-1", "Display P3"), 271 | gamma_transform("sRGB"), 272 | ], 273 | clf_transform_id, 274 | "AP0 to sRGB Encoded P3-D65", 275 | "ACES2065-1", 276 | "sRGB Encoded P3-D65 primaries, D65 white point", 277 | ) 278 | 279 | name = "AP0_to_Gamma2.2_Encoded_AdobeRGB" 280 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 281 | filename = output_directory / clf_basename(clf_transform_id) 282 | clf_transforms[filename] = generate_clf_transform( 283 | filename, 284 | [ 285 | matrix_RGB_to_RGB_transform("ACES2065-1", "Adobe RGB (1998)"), 286 | gamma_transform(563 / 256), 287 | ], 288 | clf_transform_id, 289 | "AP0 to Gamma 2.2 Encoded AdobeRGB", 290 | "ACES2065-1", 291 | "2.2 gamma-corrected AdobeRGB primaries, D65 white point", 292 | ) 293 | 294 | return clf_transforms 295 | 296 | 297 | if __name__ == "__main__": 298 | import logging 299 | 300 | logging.basicConfig() 301 | logging.getLogger().setLevel(logging.INFO) 302 | 303 | output_directory = Path(__file__).parent.resolve() 304 | 305 | generate_clf_transforms_ocio(output_directory / "utility") 306 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.AP0_to_CIE_XYZ-D65-Scene-referred.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ACES2065-1 4 | CIE XYZ, D65 white point 5 | 6 | 7 | 0.938279849239345 -0.00445144581227847 0.0166275235564231 8 | 0.337368890823117 0.729521566676754 -0.066890457499083 9 | 0.00117395084939056 -0.00371070640198378 1.09159450636463 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.AP0_to_Gamma1.8_Encoded_Rec709.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ACES2065-1 4 | 1.8 gamma-corrected Rec.709 primaries, D65 white point 5 | 6 | 7 | 2.52168618674388 -1.13413098823972 -0.387555198504164 8 | -0.276479914229922 1.37271908766826 -0.096239173438334 9 | -0.0153780649660342 -0.152975335867399 1.16835340083343 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.AP0_to_Gamma2.2_Encoded_AP1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ACES2065-1 4 | 2.2 gamma-corrected AP1 primaries, ACES ~=D60 white point 5 | 6 | 7 | 1.45143931614567 -0.23651074689374 -0.214928569251925 8 | -0.0765537733960206 1.17622969983357 -0.0996759264375522 9 | 0.00831614842569772 -0.00603244979102102 0.997716301365323 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.AP0_to_Gamma2.2_Encoded_AdobeRGB.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ACES2065-1 4 | 2.2 gamma-corrected AdobeRGB primaries, D65 white point 5 | 6 | 7 | 1.72456031681181 -0.419993594161504 -0.304566722650304 8 | -0.276479914229922 1.37271908766826 -0.0962391734383339 9 | -0.0261255258256649 -0.0901747806551909 1.11630030648086 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.AP0_to_Gamma2.2_Encoded_Rec709.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ACES2065-1 4 | 2.2 gamma-corrected Rec.709 primaries, D65 white point 5 | 6 | 7 | 2.52168618674388 -1.13413098823972 -0.387555198504164 8 | -0.276479914229922 1.37271908766826 -0.096239173438334 9 | -0.0153780649660342 -0.152975335867399 1.16835340083343 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.AP0_to_Gamma2.4_Encoded_Rec709.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ACES2065-1 4 | 2.4 gamma-corrected Rec.709 primaries, D65 white point 5 | 6 | 7 | 2.52168618674388 -1.13413098823972 -0.387555198504164 8 | -0.276479914229922 1.37271908766826 -0.096239173438334 9 | -0.0153780649660342 -0.152975335867399 1.16835340083343 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.AP0_to_Linear_AdobeRGB.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ACES2065-1 4 | linear Adobe RGB (1998) primaries, D65 white point 5 | 6 | 7 | 1.72456031681181 -0.419993594161504 -0.304566722650304 8 | -0.276479914229922 1.37271908766826 -0.0962391734383339 9 | -0.0261255258256649 -0.0901747806551909 1.11630030648086 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.AP0_to_Linear_P3-D65.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ACES2065-1 4 | linear P3 primaries, D65 white point 5 | 6 | 7 | 2.02490528596679 -0.689069761034766 -0.335835524932019 8 | -0.183597032256178 1.28950620775902 -0.105909175502841 9 | 0.00905856112234766 -0.0592796840575522 1.0502211229352 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.AP0_to_Linear_Rec2020.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ACES2065-1 4 | linear Rec.2020 primaries, D65 white point 5 | 6 | 7 | 1.49040952054172 -0.26617091926613 -0.224238601275593 8 | -0.0801674998722558 1.18216712109757 -0.10199962122531 9 | 0.00322763119162216 -0.0347764757450576 1.03154884455344 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.AP0_to_Linear_Rec709.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ACES2065-1 4 | linear Rec.709 primaries, D65 white point 5 | 6 | 7 | 2.52168618674388 -1.13413098823972 -0.387555198504164 8 | -0.276479914229922 1.37271908766826 -0.096239173438334 9 | -0.0153780649660342 -0.152975335867399 1.16835340083343 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.AP0_to_sRGB-Encoded-Rec709.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ACES2065-1 4 | sRGB 5 | 6 | 7 | 2.52168618674388 -1.13413098823972 -0.387555198504164 8 | -0.276479914229922 1.37271908766826 -0.096239173438334 9 | -0.0153780649660342 -0.152975335867399 1.16835340083343 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.AP0_to_sRGB_Encoded_AP1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ACES2065-1 4 | sRGB Encoded AP1 primaries, ACES ~=D60 white point 5 | 6 | 7 | 1.45143931614567 -0.23651074689374 -0.214928569251925 8 | -0.0765537733960206 1.17622969983357 -0.0996759264375522 9 | 0.00831614842569772 -0.00603244979102102 0.997716301365323 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.AP0_to_sRGB_Encoded_P3-D65.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ACES2065-1 4 | sRGB Encoded P3-D65 primaries, D65 white point 5 | 6 | 7 | 2.02490528596679 -0.689069761034766 -0.335835524932019 8 | -0.183597032256178 1.28950620775902 -0.105909175502841 9 | 0.00905856112234766 -0.0592796840575522 1.0502211229352 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.Rec1886-Curve.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | generic linear RGB 4 | Rec.1886 encoded RGB 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/ocio/utility/OCIO.Utility.sRGB-Curve.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | generic linear RGB 4 | sRGB encoded RGB 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/panasonic/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .generate import ( 5 | generate_clf_transforms_panasonic, 6 | ) 7 | 8 | __all__ = [ 9 | "generate_clf_transforms_panasonic", 10 | ] 11 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/panasonic/generate.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | *Panasonic* CLF Transforms Generation 5 | ===================================== 6 | 7 | Defines procedures for generating Panasonic *Common LUT Format* (CLF) 8 | transforms: 9 | 10 | - :func:`opencolorio_config_aces.clf.generate_clf_transforms_panasonic` 11 | """ 12 | 13 | from pathlib import Path 14 | 15 | import PyOpenColorIO as ocio 16 | 17 | from opencolorio_config_aces.clf.transforms import ( 18 | clf_basename, 19 | format_clf_transform_id, 20 | generate_clf_transform, 21 | matrix_RGB_to_RGB_transform, 22 | ) 23 | from opencolorio_config_aces.config import transform_factory 24 | 25 | __author__ = "OpenColorIO Contributors" 26 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 27 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 28 | __maintainer__ = "OpenColorIO Contributors" 29 | __email__ = "ocio-dev@lists.aswf.io" 30 | __status__ = "Production" 31 | 32 | __all__ = [ 33 | "FAMILY", 34 | "GENUS", 35 | "VERSION", 36 | "generate_clf_transforms_panasonic", 37 | ] 38 | 39 | FAMILY = "Panasonic" 40 | """ 41 | *CLF* transforms family. 42 | """ 43 | 44 | GENUS = "Input" 45 | """ 46 | *CLF* transforms genus. 47 | """ 48 | 49 | VERSION = "1.0" 50 | """ 51 | *CLF* transforms version. 52 | """ 53 | 54 | 55 | def generate_clf_transforms_panasonic(output_directory): 56 | """ 57 | Make the CLF file for V-Log - V-Gamut plus matrix/curve CLFs. 58 | 59 | Returns 60 | ------- 61 | dict 62 | Dictionary of *CLF* transforms and *OpenColorIO* `GroupTransform` 63 | instances. 64 | 65 | References 66 | ---------- 67 | - Panasonic. (2014). VARICAM V-Log/V-Gamut (pp. 1-7). 68 | http://pro-av.panasonic.net/en/varicam/common/pdf/\ 69 | VARICAM_V-Log_V-Gamut.pdf 70 | 71 | Notes 72 | ----- 73 | - The resulting *CLF* transforms were reviewed by *Panasonic*. 74 | """ 75 | 76 | output_directory.mkdir(parents=True, exist_ok=True) 77 | 78 | clf_transforms = {} 79 | 80 | cut1 = 0.01 81 | b = 0.00873 82 | c = 0.241514 83 | d = 0.598206 84 | 85 | LIN_SLP = 1.0 86 | LIN_OFF = b 87 | LOG_SLP = c 88 | LOG_OFF = d 89 | LIN_SB = cut1 90 | BASE = 10.0 91 | 92 | lct = transform_factory( 93 | transform_type="LogCameraTransform", 94 | transform_factory="Constructor", 95 | base=BASE, 96 | linSideBreak=[LIN_SB] * 3, 97 | logSideSlope=[LOG_SLP] * 3, 98 | logSideOffset=[LOG_OFF] * 3, 99 | linSideSlope=[LIN_SLP] * 3, 100 | linSideOffset=[LIN_OFF] * 3, 101 | direction=ocio.TRANSFORM_DIR_INVERSE, 102 | ) 103 | 104 | mtx = matrix_RGB_to_RGB_transform("V-Gamut", "ACES2065-1", "Bradford") 105 | 106 | # Using the CSC ID here because there is a slight discrepancy between the matrix 107 | # coefficients of the CSC and IDT CTL and the CLF matches the CSC transform. 108 | aces_transform_id = ( 109 | "urn:ampas:aces:transformId:v2.0:CSC.Panasonic.VLog_VGamut_to_ACES.a2.v1" 110 | ) 111 | 112 | # Generate full transform. 113 | 114 | name = "VLog_VGamut_to_ACES2065-1" 115 | input_descriptor = "Panasonic V-Log - V-Gamut" 116 | output_descriptor = "ACES2065-1" 117 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 118 | filename = output_directory / clf_basename(clf_transform_id) 119 | clf_transforms[filename] = generate_clf_transform( 120 | filename, 121 | [lct, mtx], 122 | clf_transform_id, 123 | f"{input_descriptor} to {output_descriptor}", 124 | input_descriptor, 125 | output_descriptor, 126 | aces_transform_id, 127 | ) 128 | 129 | # Generate transform for primaries only. 130 | 131 | name = "Linear_VGamut_to_ACES2065-1" 132 | input_descriptor = "Linear Panasonic V-Gamut" 133 | output_descriptor = "ACES2065-1" 134 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 135 | filename = output_directory / clf_basename(clf_transform_id) 136 | clf_transforms[filename] = generate_clf_transform( 137 | filename, 138 | [mtx], 139 | clf_transform_id, 140 | f"{input_descriptor} to {output_descriptor}", 141 | input_descriptor, 142 | output_descriptor, 143 | ) 144 | 145 | # Generate `NamedTransform` for log curve only. 146 | name = "VLog-Curve_to_Linear" 147 | input_descriptor = "Panasonic V-Log Log (arbitrary primaries)" 148 | output_descriptor = "Panasonic V-Log Linear (arbitrary primaries)" 149 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 150 | filename = output_directory / clf_basename(clf_transform_id) 151 | clf_transforms[filename] = generate_clf_transform( 152 | filename, 153 | [lct], 154 | clf_transform_id, 155 | f'{input_descriptor.replace(" (arbitrary primaries)", "")} to Linear Curve', 156 | input_descriptor, 157 | output_descriptor, 158 | ) 159 | 160 | return clf_transforms 161 | 162 | 163 | if __name__ == "__main__": 164 | import logging 165 | 166 | logging.basicConfig() 167 | logging.getLogger().setLevel(logging.INFO) 168 | 169 | output_directory = Path(__file__).parent.resolve() / "input" 170 | 171 | generate_clf_transforms_panasonic(output_directory) 172 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/panasonic/input/Panasonic.Input.Linear_VGamut_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Linear Panasonic V-Gamut 4 | ACES2065-1 5 | 6 | 7 | 0.72461670413153 0.166915288193706 0.108468007674764 8 | 0.021390245413146 0.984908155703054 -0.00629840111620089 9 | -0.00923556287076561 -0.00105690563900513 1.01029246850977 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/panasonic/input/Panasonic.Input.VLog-Curve.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Panasonic V-Log Log (arbitrary primaries) 4 | Panasonic V-Log Linear (arbitrary primaries) 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/panasonic/input/Panasonic.Input.VLog_VGamut_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Panasonic V-Log - V-Gamut 4 | ACES2065-1 5 | 6 | urn:ampas:aces:transformId:v2.0:CSC.Panasonic.VLog_VGamut_to_ACES.a2.v1 7 | 8 | 9 | 10 | 11 | 12 | 13 | 0.72461670413153 0.166915288193706 0.108468007674764 14 | 0.021390245413146 0.984908155703054 -0.00629840111620089 15 | -0.00923556287076561 -0.00105690563900513 1.01029246850977 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/red/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .generate import ( 5 | generate_clf_transforms_red, 6 | ) 7 | 8 | __all__ = [ 9 | "generate_clf_transforms_red", 10 | ] 11 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/red/generate.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | *RED* CLF Transforms Generation 5 | =============================== 6 | 7 | Defines procedures for generating RED *Common LUT Format* (CLF) 8 | transforms: 9 | 10 | - :func:`opencolorio_config_aces.clf.generate_clf_transforms_red` 11 | """ 12 | 13 | from pathlib import Path 14 | 15 | import PyOpenColorIO as ocio 16 | 17 | from opencolorio_config_aces.clf.transforms import ( 18 | clf_basename, 19 | format_clf_transform_id, 20 | generate_clf_transform, 21 | matrix_RGB_to_RGB_transform, 22 | ) 23 | from opencolorio_config_aces.config import transform_factory 24 | 25 | __author__ = "OpenColorIO Contributors" 26 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 27 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 28 | __maintainer__ = "OpenColorIO Contributors" 29 | __email__ = "ocio-dev@lists.aswf.io" 30 | __status__ = "Production" 31 | 32 | __all__ = [ 33 | "FAMILY", 34 | "GENUS", 35 | "VERSION", 36 | "generate_clf_transforms_red", 37 | ] 38 | 39 | FAMILY = "RED" 40 | """ 41 | *CLF* transforms family. 42 | """ 43 | 44 | GENUS = "Input" 45 | """ 46 | *CLF* transforms genus. 47 | """ 48 | 49 | VERSION = "1.0" 50 | """ 51 | *CLF* transforms version. 52 | """ 53 | 54 | 55 | def generate_clf_transforms_red(output_directory): 56 | """ 57 | Make the CLF file for RED Log3G10 REDWideGamutRGB plus matrix/curve CLFs. 58 | 59 | Returns 60 | ------- 61 | dict 62 | Dictionary of *CLF* transforms and *OpenColorIO* `GroupTransform` 63 | instances. 64 | 65 | References 66 | ---------- 67 | - RED Digital Cinema. (2017). White Paper on REDWideGamutRGB and Log3G10. 68 | Retrieved January 16, 2021, from https://www.red.com/download/\ 69 | white-paper-on-redwidegamutrgb-and-log3g10 70 | 71 | Notes 72 | ----- 73 | - The resulting *CLF* transforms were reviewed by *RED*. 74 | """ 75 | 76 | output_directory.mkdir(parents=True, exist_ok=True) 77 | 78 | clf_transforms = {} 79 | 80 | linSideSlope = 155.975327 81 | linSideOffset = 0.01 * linSideSlope + 1.0 82 | logSideSlope = 0.224282 83 | logSideOffset = 0.0 84 | linSideBreak = -0.01 85 | base = 10.0 86 | 87 | lct = transform_factory( 88 | transform_type="LogCameraTransform", 89 | transform_factory="Constructor", 90 | base=base, 91 | linSideBreak=[linSideBreak] * 3, 92 | logSideSlope=[logSideSlope] * 3, 93 | logSideOffset=[logSideOffset] * 3, 94 | linSideSlope=[linSideSlope] * 3, 95 | linSideOffset=[linSideOffset] * 3, 96 | direction=ocio.TRANSFORM_DIR_INVERSE, 97 | ) 98 | 99 | mtx = matrix_RGB_to_RGB_transform("REDWideGamutRGB", "ACES2065-1", "Bradford") 100 | 101 | aces_transform_id = ( 102 | "urn:ampas:aces:transformId:v2.0:CSC.Red.Log3G10_RWG_to_ACES.a2.v1" 103 | ) 104 | 105 | # Generate full transform. 106 | 107 | name = "Log3G10_REDWideGamutRGB_to_ACES2065-1" 108 | input_descriptor = "RED Log3G10 REDWideGamutRGB" 109 | output_descriptor = "ACES2065-1" 110 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 111 | filename = output_directory / clf_basename(clf_transform_id) 112 | clf_transforms[filename] = generate_clf_transform( 113 | filename, 114 | [lct, mtx], 115 | clf_transform_id, 116 | f"{input_descriptor} to {output_descriptor}", 117 | input_descriptor, 118 | output_descriptor, 119 | aces_transform_id, 120 | ) 121 | 122 | # Generate transform for primaries only. 123 | 124 | name = "Linear_REDWideGamutRGB_to_ACES2065-1" 125 | input_descriptor = "Linear REDWideGamutRGB" 126 | output_descriptor = "ACES2065-1" 127 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 128 | filename = output_directory / clf_basename(clf_transform_id) 129 | clf_transforms[filename] = generate_clf_transform( 130 | filename, 131 | [mtx], 132 | clf_transform_id, 133 | f"{input_descriptor} to {output_descriptor}", 134 | input_descriptor, 135 | output_descriptor, 136 | ) 137 | 138 | # Generate `NamedTransform` for log curve only. 139 | 140 | name = "Log3G10-Curve_to_Linear" 141 | clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) 142 | input_descriptor = "RED Log3G10 Log (arbitrary primaries)" 143 | output_descriptor = "RED Log3G10 Linear (arbitrary primaries)" 144 | filename = output_directory / clf_basename(clf_transform_id) 145 | clf_transforms[filename] = generate_clf_transform( 146 | filename, 147 | [lct], 148 | clf_transform_id, 149 | f'{input_descriptor.replace(" (arbitrary primaries)", "")} to Linear Curve', 150 | input_descriptor, 151 | output_descriptor, 152 | ) 153 | 154 | return clf_transforms 155 | 156 | 157 | if __name__ == "__main__": 158 | import logging 159 | 160 | logging.basicConfig() 161 | logging.getLogger().setLevel(logging.INFO) 162 | 163 | output_directory = Path(__file__).parent.resolve() / "input" 164 | 165 | generate_clf_transforms_red(output_directory) 166 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/red/input/RED.Input.Linear_REDWideGamutRGB_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Linear REDWideGamutRGB 4 | ACES2065-1 5 | 6 | 7 | 0.785058804068092 0.0838587565440846 0.131082439387823 8 | 0.0231738348454756 1.08789754919233 -0.111071384037806 9 | -0.0737604353682082 -0.314590072290208 1.38835050765842 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/red/input/RED.Input.Log3G10-Curve.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | RED Log3G10 Log (arbitrary primaries) 4 | RED Log3G10 Linear (arbitrary primaries) 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/red/input/RED.Input.Log3G10_REDWideGamutRGB_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | RED Log3G10 REDWideGamutRGB 4 | ACES2065-1 5 | 6 | urn:ampas:aces:transformId:v2.0:CSC.Red.Log3G10_RWG_to_ACES.a2.v1 7 | 8 | 9 | 10 | 11 | 12 | 13 | 0.785058804068092 0.0838587565440846 0.131082439387823 14 | 0.0231738348454756 1.08789754919233 -0.111071384037806 15 | -0.0737604353682082 -0.314590072290208 1.38835050765842 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/sony/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .generate import ( 5 | generate_clf_transforms_sony, 6 | ) 7 | 8 | __all__ = [ 9 | "generate_clf_transforms_sony", 10 | ] 11 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/sony/input/Sony.Input.Linear_SGamut3Cine_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Linear S-Gamut3.Cine 4 | ACES2065-1 5 | 6 | 7 | 0.638788667185978 0.272351433711262 0.0888598991027595 8 | -0.00391590602528224 1.0880732308974 -0.0841573248721177 9 | -0.0299072021239151 -0.0264325799101947 1.05633978203411 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/sony/input/Sony.Input.Linear_SGamut3_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Linear S-Gamut3 4 | ACES2065-1 5 | 6 | 7 | 0.75298259539984 0.143370216235557 0.103647188364603 8 | 0.0217076974414429 1.01531883550528 -0.0370265329467195 9 | -0.00941605274963355 0.00337041785882367 1.00604563489081 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/sony/input/Sony.Input.Linear_SGamut_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Linear S-Gamut 4 | ACES2065-1 5 | 6 | 7 | 0.75298259539984 0.143370216235557 0.103647188364603 8 | 0.0217076974414429 1.01531883550528 -0.0370265329467195 9 | -0.00941605274963355 0.00337041785882367 1.00604563489081 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/sony/input/Sony.Input.Linear_Venice_SGamut3Cine_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Linear Venice S-Gamut3.Cine 4 | ACES2065-1 5 | 6 | 7 | 0.674257092126512 0.220571735923397 0.10517117195009 8 | -0.00931360607857167 1.10595886142466 -0.0966452553460855 9 | -0.0382090673002312 -0.017938376600236 1.05614744390047 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/sony/input/Sony.Input.Linear_Venice_SGamut3_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Linear Venice S-Gamut3 4 | ACES2065-1 5 | 6 | 7 | 0.793329741146434 0.089078625620677 0.117591633232888 8 | 0.0155810585252582 1.03271230692988 -0.0482933654551394 9 | -0.0188647477991488 0.0127694120973433 1.00609533570181 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/sony/input/Sony.Input.SLog2-Curve.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | S-Log2 Log (arbitrary primaries) 4 | S-Log2 Linear (arbitrary primaries) 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/sony/input/Sony.Input.SLog2_SGamut_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sony S-Log2 S-Gamut 4 | ACES2065-1 5 | 6 | 7 | 8 | 9 | 10 | 0.75298259539984 0.143370216235557 0.103647188364603 11 | 0.0217076974414429 1.01531883550528 -0.0370265329467195 12 | -0.00941605274963355 0.00337041785882367 1.00604563489081 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/sony/input/Sony.Input.SLog3-Curve.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | S-Log3 Log (arbitrary primaries) 4 | S-Log3 Linear (arbitrary primaries) 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/sony/input/Sony.Input.SLog3_SGamut3Cine_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sony S-Log3 S-Gamut3.Cine 4 | ACES2065-1 5 | 6 | urn:ampas:aces:transformId:v2.0:CSC.Sony.SLog3_SGamut3Cine_to_ACES.a2.v1 7 | 8 | 9 | 10 | 11 | 12 | 13 | 0.638788667185978 0.272351433711262 0.0888598991027595 14 | -0.00391590602528224 1.0880732308974 -0.0841573248721177 15 | -0.0299072021239151 -0.0264325799101947 1.05633978203411 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/sony/input/Sony.Input.SLog3_SGamut3_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sony S-Log3 S-Gamut3 4 | ACES2065-1 5 | 6 | urn:ampas:aces:transformId:v2.0:CSC.Sony.SLog3_SGamut3_to_ACES.a2.v1 7 | 8 | 9 | 10 | 11 | 12 | 13 | 0.75298259539984 0.143370216235557 0.103647188364603 14 | 0.0217076974414429 1.01531883550528 -0.0370265329467195 15 | -0.00941605274963355 0.00337041785882367 1.00604563489081 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/sony/input/Sony.Input.SLog3_Venice_SGamut3Cine_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sony S-Log3 Venice S-Gamut3.Cine 4 | ACES2065-1 5 | 6 | urn:ampas:aces:transformId:v2.0:CSC.Sony.Venice_SLog3_SGamut3Cine_to_ACES.a2.v1 7 | 8 | 9 | 10 | 11 | 12 | 13 | 0.674257092126512 0.220571735923397 0.10517117195009 14 | -0.00931360607857167 1.10595886142466 -0.0966452553460855 15 | -0.0382090673002312 -0.017938376600236 1.05614744390047 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/sony/input/Sony.Input.SLog3_Venice_SGamut3_to_ACES2065-1.clf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sony S-Log3 Venice S-Gamut3 4 | ACES2065-1 5 | 6 | urn:ampas:aces:transformId:v2.0:CSC.Sony.Venice_SLog3_SGamut3_to_ACES.a2.v1 7 | 8 | 9 | 10 | 11 | 12 | 13 | 0.793329741146434 0.089078625620677 0.117591633232888 14 | 0.0155810585252582 1.03271230692988 -0.0482933654551394 15 | -0.0188647477991488 0.0127694120973433 1.00609533570181 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /opencolorio_config_aces/clf/transforms/utilities.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | CLF Generation Utilities 5 | ======================== 6 | 7 | Defines various utility functions for generating *Common LUT Format* 8 | (CLF) transforms. 9 | """ 10 | 11 | import logging 12 | import re 13 | 14 | import PyOpenColorIO as ocio 15 | 16 | from opencolorio_config_aces.clf.discover.classify import ( 17 | EXTENSION_CLF, 18 | SEPARATOR_ID_CLF, 19 | URN_CLF, 20 | ) 21 | from opencolorio_config_aces.config import produce_transform, transform_factory 22 | from opencolorio_config_aces.utilities import required 23 | 24 | __author__ = "OpenColorIO Contributors" 25 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 26 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 27 | __maintainer__ = "OpenColorIO Contributors" 28 | __email__ = "ocio-dev@lists.aswf.io" 29 | __status__ = "Production" 30 | 31 | __all__ = [ 32 | "matrix_transform", 33 | "matrix_RGB_to_RGB_transform", 34 | "gamma_transform", 35 | "generate_clf_transform", 36 | "format_clf_transform_id", 37 | "clf_basename", 38 | ] 39 | 40 | LOGGER = logging.getLogger(__name__) 41 | 42 | 43 | @required("Colour") 44 | def matrix_transform(matrix, offset=None): 45 | """ 46 | Convert given *NumPy* array into an *OpenColorIO* `MatrixTransform`. 47 | 48 | Parameters 49 | ---------- 50 | matrix : array_like 51 | 3x3 matrix. 52 | offset : array_like 53 | Optional RGB offsets. 54 | 55 | Returns 56 | ------- 57 | ocio.MatrixTransform 58 | `MatrixTransform` representation of provided array(s). 59 | """ 60 | 61 | import numpy as np 62 | 63 | matrix44 = np.zeros((4, 4)) 64 | matrix44[3, 3] = 1.0 65 | for i in range(3): 66 | matrix44[i, 0:3] = matrix[i, :] 67 | 68 | offset4 = np.zeros(4) 69 | if offset is not None: 70 | offset4[0:3] = offset 71 | 72 | return transform_factory( 73 | transform_type="MatrixTransform", 74 | matrix=list(matrix44.ravel()), 75 | offset=list(offset4), 76 | ) 77 | 78 | 79 | @required("Colour") 80 | def matrix_RGB_to_RGB_transform( 81 | input_primaries, output_primaries, adaptation="Bradford" 82 | ): 83 | """ 84 | Calculate the *RGB* to *RGB* matrix for a pair of primaries and produce an 85 | *OpenColorIO* `MatrixTransform`. 86 | 87 | Parameters 88 | ---------- 89 | input_primaries : str 90 | Input RGB colourspace name, as defined by colour-science. 91 | output_primaries : str 92 | Output RGB colourspace name, as defined by colour-science. 93 | adaptation : str 94 | Chromatic adaptation method to use, as defined by colour-science. 95 | Defaults to "Bradford" to match what is most commonly used in ACES. 96 | 97 | Returns 98 | ------- 99 | ocio.MatrixTransform 100 | *OpenColorIO* `MatrixTransform`. 101 | """ 102 | 103 | import colour 104 | 105 | input_space = colour.RGB_COLOURSPACES[input_primaries] 106 | input_space.use_derived_transformation_matrices(True) 107 | output_space = colour.RGB_COLOURSPACES[output_primaries] 108 | output_space.use_derived_transformation_matrices(True) 109 | 110 | return matrix_transform( 111 | colour.matrix_RGB_to_RGB( 112 | input_space, 113 | output_space, 114 | chromatic_adaptation_transform=adaptation, 115 | ) 116 | ) 117 | 118 | 119 | def gamma_transform(gamma): 120 | """ 121 | Convert a gamma value into an *OpenColorIO* `ExponentTransform` or 122 | `ExponentWithLinearTransform`. 123 | 124 | Parameters 125 | ---------- 126 | gamma : float | str 127 | Exponent value or special gamma keyword (currently only 'sRGB' is 128 | supported). 129 | 130 | Returns 131 | ------- 132 | ocio.ExponentTransform or ocio.ExponentWithLinearTransform 133 | *OpenColorIO* `ExponentTransform` or `ExponentWithLinearTransform`. 134 | """ 135 | 136 | import numpy as np 137 | 138 | # NB: Preference of working group during 2021-11-23 mtg was *not* to clamp. 139 | direction = ocio.TRANSFORM_DIR_INVERSE 140 | 141 | if gamma == "sRGB": 142 | value = np.zeros(4) 143 | value[0:3] = 2.4 144 | value[3] = 1.0 145 | 146 | offset = np.zeros(4) 147 | offset[0:3] = 0.055 148 | 149 | exp_tf = transform_factory( 150 | transform_type="ExponentWithLinearTransform", 151 | gamma=value, 152 | offset=offset, 153 | negativeStyle=ocio.NEGATIVE_LINEAR, 154 | direction=direction, 155 | ) 156 | 157 | elif gamma == "Rec709": 158 | value = np.zeros(4) 159 | value[0:3] = 1.0 / 0.45 160 | value[3] = 1.0 161 | 162 | offset = np.zeros(4) 163 | offset[0:3] = 0.099 164 | 165 | exp_tf = transform_factory( 166 | transform_type="ExponentWithLinearTransform", 167 | gamma=value, 168 | offset=offset, 169 | negativeStyle=ocio.NEGATIVE_LINEAR, 170 | direction=direction, 171 | ) 172 | 173 | else: 174 | value = np.ones(4) 175 | value[0:3] = gamma 176 | 177 | exp_tf = transform_factory( 178 | transform_type="ExponentTransform", 179 | value=value, 180 | negativeStyle=ocio.NEGATIVE_PASS_THRU, 181 | direction=direction, 182 | ) 183 | 184 | return exp_tf 185 | 186 | 187 | def generate_clf_transform( 188 | filename, 189 | transforms, 190 | clf_transform_id, 191 | name, 192 | input_desc, 193 | output_desc, 194 | aces_transform_id=None, 195 | style=None, 196 | ): 197 | """ 198 | Take a list of transforms and some metadata and write a *CLF* transform 199 | file. 200 | 201 | Parameters 202 | ---------- 203 | filename : str 204 | *CLF* filename. 205 | transforms : list 206 | Transforms to generate the *CLF* transform file for. 207 | clf_transform_id : str 208 | *CLFtransformID*. 209 | name : str 210 | *CLF* transform name. 211 | input_desc : str 212 | *CLF* input descriptor. 213 | output_desc : str 214 | *CLF* output descriptor. 215 | aces_transform_id : str, optional 216 | *ACEStransformID*. 217 | style : str, optional 218 | *OpenColorIO* builtin transform style. 219 | 220 | Returns 221 | ------- 222 | ocio.GroupTransform 223 | Updated `GroupTransform`. 224 | """ 225 | 226 | LOGGER.info('Creating "%s" "CLF" transform...', clf_transform_id) 227 | 228 | group_tf = produce_transform(transforms) 229 | 230 | metadata = group_tf.getFormatMetadata() 231 | metadata.setID(clf_transform_id) 232 | metadata.setName(name) 233 | metadata.addChildElement("InputDescriptor", input_desc) 234 | metadata.addChildElement("OutputDescriptor", output_desc) 235 | 236 | if aces_transform_id is not None or style is not None: 237 | metadata.addChildElement("Info", "") 238 | info = metadata.getChildElements()[2] 239 | 240 | if aces_transform_id: 241 | info.addChildElement("ACEStransformID", aces_transform_id) 242 | 243 | if style: 244 | info.addChildElement("BuiltinTransform", style) 245 | 246 | LOGGER.info('Writing "%s" "CLF" transform to "%s".', clf_transform_id, filename) 247 | 248 | group_tf.write( 249 | formatName="Academy/ASC Common LUT Format", 250 | config=ocio.Config.CreateRaw(), 251 | fileName=str(filename), 252 | ) 253 | 254 | return group_tf 255 | 256 | 257 | def format_clf_transform_id(family, genus, name, version): 258 | """ 259 | Format given *CLF* transform attributes to produce a *CLFtransformID*. 260 | 261 | Parameters 262 | ---------- 263 | family : unicode 264 | *CLF* transform family. 265 | genus : unicode 266 | *CLF* transform genus. 267 | name : unicode 268 | *CLF* transform name. 269 | version : unicode 270 | *CLF* transform version. 271 | 272 | Returns 273 | ------- 274 | unicode 275 | *CLFtransformID*. 276 | 277 | Examples 278 | -------- 279 | >>> format_clf_transform_id("OCIO", "Input", "AP0_to_sRGB-Rec709", "1.0") 280 | 'urn:aswf:ocio:transformId:1.0:OCIO:Input:AP0_to_sRGB-Rec709:1.0' 281 | """ 282 | 283 | return SEPARATOR_ID_CLF.join([URN_CLF, family, genus, name, version]) 284 | 285 | 286 | def clf_basename(clf_transform_id): 287 | """ 288 | Generate a *CLF* basename from given *CLFtransformID*. 289 | 290 | Parameters 291 | ---------- 292 | clf_transform_id : unicode 293 | *CLFtransformID* 294 | 295 | Returns 296 | ------- 297 | unicode 298 | *CLF* transform filename. 299 | 300 | Examples 301 | -------- 302 | >>> clf_basename( 303 | ... "urn:aswf:ocio:transformId:1.0:OCIO:Input:AP0_to_sRGB-Rec709:1.0") 304 | 'OCIO.Input.AP0_to_sRGB-Rec709.clf' 305 | """ 306 | 307 | tokens = clf_transform_id.replace(f"{URN_CLF}{SEPARATOR_ID_CLF}", "").split( 308 | SEPARATOR_ID_CLF 309 | ) 310 | 311 | stem = ".".join(tokens[:-1]) 312 | stem = re.sub(r"\.Linear_to_", ".", stem) 313 | stem = re.sub("_to_Linear$", "", stem) 314 | 315 | return f"{stem}{EXTENSION_CLF}" 316 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .generation import ( 5 | TRANSFORM_FACTORIES, 6 | colorspace_factory, 7 | group_transform_factory, 8 | look_factory, 9 | named_transform_factory, 10 | produce_transform, 11 | transform_factory, 12 | view_transform_factory, 13 | ) 14 | from .generation import ( 15 | BUILTIN_TRANSFORMS, 16 | BUILD_CONFIGURATIONS, 17 | BUILD_VARIANT_FILTERERS, 18 | ConfigData, 19 | PROFILE_VERSION_DEFAULT, 20 | PROFILE_VERSIONS, 21 | BuildConfiguration, 22 | deserialize_config_data, 23 | generate_config, 24 | serialize_config_data, 25 | validate_config, 26 | ) 27 | from .reference import ( 28 | build_aces_conversion_graph, 29 | classify_aces_ctl_transforms, 30 | conversion_path, 31 | ctl_transform_to_node, 32 | discover_aces_ctl_transforms, 33 | filter_ctl_transforms, 34 | filter_nodes, 35 | generate_amf_components, 36 | node_to_ctl_transform, 37 | plot_aces_conversion_graph, 38 | print_aces_taxonomy, 39 | unclassify_ctl_transforms, 40 | version_aces_dev, 41 | ) 42 | from .reference import ( 43 | DescriptionStyle, 44 | generate_config_aces, 45 | ) 46 | from .cg import generate_config_cg 47 | from .studio import generate_config_studio 48 | 49 | __all__ = [ 50 | "TRANSFORM_FACTORIES", 51 | "colorspace_factory", 52 | "group_transform_factory", 53 | "look_factory", 54 | "named_transform_factory", 55 | "produce_transform", 56 | "transform_factory", 57 | "view_transform_factory", 58 | ] 59 | __all__ += [ 60 | "BUILTIN_TRANSFORMS", 61 | "BUILD_CONFIGURATIONS", 62 | "BUILD_VARIANT_FILTERERS", 63 | "ConfigData", 64 | "PROFILE_VERSION_DEFAULT", 65 | "PROFILE_VERSIONS", 66 | "BuildConfiguration", 67 | "deserialize_config_data", 68 | "generate_config", 69 | "serialize_config_data", 70 | "validate_config", 71 | ] 72 | __all__ += [ 73 | "build_aces_conversion_graph", 74 | "classify_aces_ctl_transforms", 75 | "conversion_path", 76 | "ctl_transform_to_node", 77 | "discover_aces_ctl_transforms", 78 | "filter_ctl_transforms", 79 | "filter_nodes", 80 | "generate_amf_components", 81 | "node_to_ctl_transform", 82 | "plot_aces_conversion_graph", 83 | "print_aces_taxonomy", 84 | "unclassify_ctl_transforms", 85 | "version_aces_dev", 86 | ] 87 | __all__ += [ 88 | "DescriptionStyle", 89 | "generate_config_aces", 90 | ] 91 | __all__ += ["generate_config_cg"] 92 | __all__ += ["generate_config_studio"] 93 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/cg/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .generate import generate_config_cg 5 | 6 | __all__ = ["generate_config_cg"] 7 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/cg/generate/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .config import generate_config_cg 5 | 6 | __all__ = ["generate_config_cg"] 7 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/cg/generate/resources/OpenColorIO-Config-ACES CG and Studio Transforms - v3 - CG Config - Mapping.csv: -------------------------------------------------------------------------------- 1 | Ordering,Colorspace,Legacy,ACEStransformID,CLFtransformID,Interface,BuiltinTransform Style,Aliases,Encoding,Categories 2 | 100,ACEScc,TRUE,urn:ampas:aces:transformId:v2.0:CSC.Academy.ACEScc_to_ACES.a2.v1,,ColorSpace,ACEScc_to_ACES2065-1,"acescc,acescc_ap1,ACES - ACEScc",log,file-io 3 | 100,ACEScct,TRUE,urn:ampas:aces:transformId:v2.0:CSC.Academy.ACEScct_to_ACES.a2.v1,,ColorSpace,ACEScct_to_ACES2065-1,"acescct,acescct_ap1,ACES - ACEScct",log,"file-io,working-space" 4 | 100,ACEScg,TRUE,urn:ampas:aces:transformId:v2.0:CSC.Academy.ACEScg_to_ACES.a2.v1,,ColorSpace,ACEScg_to_ACES2065-1,"acescg,lin_ap1,lin_ap1_scene,ACES - ACEScg",scene-linear,"file-io,working-space,texture" 5 | 300,ACES 1.3 Reference Gamut Compression,FALSE,urn:ampas:aces:transformId:v2.0:Look.Academy.ReferenceGamutCompress.a2.v1,,Look,,,scene-linear, 6 | 400,Rec709-D65_100nit_in_Rec709-D65_sRGB-Piecewise,FALSE,urn:ampas:aces:transformId:v2.0:Output.Academy.Rec709-D65_100nit_in_Rec709-D65_sRGB-Piecewise.a2.v1,,ViewTransform,ACES-OUTPUT - ACES2065-1_to_CIE-XYZ-D65 - SDR-100nit-REC709_2.0,,sdr-video,file-io 7 | 410,P3-D65_100nit_in_P3-D65_sRGB-Piecewise,FALSE,urn:ampas:aces:transformId:v2.0:Output.Academy.P3-D65_100nit_in_P3-D65_sRGB-Piecewise.a2.v1,,ViewTransform,ACES-OUTPUT - ACES2065-1_to_CIE-XYZ-D65 - SDR-100nit-P3-D65_2.0,,sdr-video,file-io 8 | 415,P3-D65_1000nit_in_P3-D65_sRGB-Piecewise,FALSE,urn:ampas:aces:transformId:v2.0:Output.Academy.P3-D65_1000nit_in_P3-D65_sRGB-Piecewise.a2.v1,,ViewTransform,ACES-OUTPUT - ACES2065-1_to_CIE-XYZ-D65 - HDR-1000nit-P3-D65_2.0,,hdr-video,file-io 9 | 425,P3-D65_48nit_in_P3-D65_Gamma2pt6,FALSE,urn:ampas:aces:transformId:v2.0:Output.Academy.P3-D65_48nit_in_P3-D65_Gamma2pt6.a2.v1,,ViewTransform,ACES-OUTPUT - ACES2065-1_to_CIE-XYZ-D65 - SDR-100nit-P3-D65_2.0,,sdr-video,file-io 10 | 435,Rec709-D65_100nit_in_Rec709-D65_BT1886,FALSE,urn:ampas:aces:transformId:v2.0:Output.Academy.Rec709-D65_100nit_in_Rec709-D65_BT1886.a2.v1,,ViewTransform,ACES-OUTPUT - ACES2065-1_to_CIE-XYZ-D65 - SDR-100nit-REC709_2.0,,sdr-video,file-io 11 | 440,sRGB - Curve,TRUE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:Linear_to_sRGB-Curve:1.0,NamedTransform,,"crv_srgb,Utility - Curve - sRGB",sdr-video,file-io 12 | 441,Rec.1886 - Curve,TRUE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:Linear_to_Rec1886-Curve:1.0,NamedTransform,,"crv_rec1886,Utility - Curve - Rec.1886",sdr-video,file-io 13 | 446,P3-D65_1000nit_in_Rec2100-D65_ST2084,FALSE,urn:ampas:aces:transformId:v2.0:Output.Academy.P3-D65_1000nit_in_Rec2100-D65_ST2084.a2.v1,,ViewTransform,ACES-OUTPUT - ACES2065-1_to_CIE-XYZ-D65 - HDR-1000nit-P3-D65_2.0,,hdr-video,file-io 14 | 456,Rec2100-D65_1000nit_in_Rec2100-D65_ST2084,FALSE,urn:ampas:aces:transformId:v2.0:Output.Academy.Rec2100-D65_1000nit_in_Rec2100-D65_ST2084.a2.v1,,ViewTransform,ACES-OUTPUT - ACES2065-1_to_CIE-XYZ-D65 - HDR-1000nit-REC2020_2.0,,hdr-video,file-io 15 | 477,P3-D65_1000nit_in_P3-D65_ST2084,FALSE,urn:ampas:aces:transformId:v2.0:Output.Academy.P3-D65_1000nit_in_P3-D65_ST2084.a2.v1,,ViewTransform,ACES-OUTPUT - ACES2065-1_to_CIE-XYZ-D65 - HDR-1000nit-P3-D65_2.0,,hdr-video,file-io 16 | 500,sRGB Encoded Rec.709 (sRGB),TRUE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:AP0_to_sRGB-Encoded-Rec709:1.0,ColorSpace,,"srgb_texture,srgb_rec709_scene,Utility - sRGB - Texture,Input - Generic - sRGB - Texture,sRGB - Texture,srgb_tx",sdr-video,"file-io,texture" 17 | 501,Gamma 1.8 Encoded Rec.709,TRUE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:AP0_to_Gamma1.8_Encoded_Rec709:1.0,ColorSpace,,"g18_rec709,Utility - Gamma 1.8 - Rec.709 - Texture,Gamma 1.8 Rec.709 - Texture,g18_rec709_tx,g18_rec709_scene",sdr-video,"file-io,texture" 18 | 502,Gamma 2.2 Encoded Rec.709,TRUE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:AP0_to_Gamma2.2_Encoded_Rec709:1.0,ColorSpace,,"g22_rec709,Utility - Gamma 2.2 - Rec.709 - Texture,Gamma 2.2 Rec.709 - Texture,g22_rec709_tx,g22_rec709_scene",sdr-video,"file-io,texture" 19 | 503,Gamma 2.4 Encoded Rec.709,FALSE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:AP0_to_Gamma2.4_Encoded_Rec709:1.0,ColorSpace,,"g24_rec709,rec709_display,Utility - Rec.709 - Display,Gamma 2.4 Rec.709 - Texture,g24_rec709_tx",sdr-video,"file-io,texture" 20 | 505,sRGB Encoded P3-D65,FALSE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:AP0_to_sRGB_Encoded_P3-D65:1.0,ColorSpace,,"srgb_p3d65,srgb_displayp3,srgb_p3d65_scene,sRGB Encoded P3-D65 - Texture,srgb_encoded_p3d65_tx",sdr-video,"file-io,texture" 21 | 506,Gamma 2.2 Encoded AdobeRGB,FALSE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:AP0_to_Gamma2.2_Encoded_AdobeRGB:1.0,ColorSpace,,"adobergb,g22_adobergb_scene",sdr-video,"file-io,texture" 22 | 507,sRGB Encoded AP1,FALSE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:AP0_to_sRGB_Encoded_AP1:1.0,ColorSpace,,"srgb_ap1,srgb_ap1_scene,sRGB Encoded AP1 - Texture,srgb_encoded_ap1_tx",sdr-video,"file-io,texture" 23 | 508,Gamma 2.2 Encoded AP1,FALSE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:AP0_to_Gamma2.2_Encoded_AP1:1.0,ColorSpace,,"g22_ap1,Gamma 2.2 AP1 - Texture,g22_ap1_tx,g22_ap1_scene",sdr-video,"file-io,texture" 24 | 520,CIE XYZ-D65 - Scene-referred,FALSE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:AP0_to_CIE_XYZ-D65-Scene-referred:1.0,ColorSpace,,lin_ciexyzd65_scene,scene-linear,file-io 25 | 520,Linear AdobeRGB,FALSE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:AP0_to_Linear_AdobeRGB:1.0,ColorSpace,,"lin_adobergb,lin_adobergb_scene,Utility - Linear - Adobe RGB",scene-linear,"file-io,texture" 26 | 520,Linear P3-D65,TRUE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:AP0_to_Linear_P3-D65:1.0,ColorSpace,,"lin_p3d65,lin_displayp3,lin_p3d65_scene,Utility - Linear - P3-D65,Linear Display P3",scene-linear,"file-io,working-space,texture" 27 | 520,Linear Rec.2020,TRUE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:AP0_to_Linear_Rec2020:1.0,ColorSpace,,"lin_rec2020,lin_rec2020_scene,Utility - Linear - Rec.2020",scene-linear,"file-io,texture" 28 | 520,Linear Rec.709 (sRGB),TRUE,,urn:aswf:ocio:transformId:1.0:OCIO:Utility:AP0_to_Linear_Rec709:1.0,ColorSpace,,"lin_rec709,lin_rec709_scene,lin_srgb,Utility - Linear - sRGB,Utility - Linear - Rec.709",scene-linear,"file-io,working-space,texture" 29 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/cg/generate/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/cg/generate/tests/test_resources.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | Defines the unit tests for the 5 | :mod:`opencolorio_config_aces.config.cg.generate` module resources. 6 | """ 7 | 8 | 9 | import unittest 10 | 11 | import requests 12 | 13 | from opencolorio_config_aces.config.cg.generate.config import ( 14 | PATH_TRANSFORMS_MAPPING_FILE_CG, 15 | URL_EXPORT_TRANSFORMS_MAPPING_FILE_CG, 16 | ) 17 | 18 | __author__ = "OpenColorIO Contributors" 19 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 20 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 21 | __maintainer__ = "OpenColorIO Contributors" 22 | __email__ = "ocio-dev@lists.aswf.io" 23 | __status__ = "Production" 24 | 25 | __all__ = [ 26 | "TestConfigResources", 27 | ] 28 | 29 | 30 | class TestConfigResources(unittest.TestCase): 31 | """ 32 | Define the *ACES* Computer Graphics (CG) *OpenColorIO* config resources 33 | unit tests methods. 34 | """ 35 | 36 | def test_csv_mapping_file(self): 37 | """Test the *CSV* mapping file.""" 38 | 39 | csv_local_path = PATH_TRANSFORMS_MAPPING_FILE_CG 40 | 41 | with open(str(csv_local_path)) as csv_local_file: 42 | csv_local_content = csv_local_file.read() 43 | 44 | csv_remote_content = requests.get( 45 | URL_EXPORT_TRANSFORMS_MAPPING_FILE_CG, timeout=60 46 | ).text 47 | 48 | self.assertMultiLineEqual( 49 | "\n".join(csv_remote_content.splitlines()), 50 | "\n".join(csv_local_content.splitlines()), 51 | ) 52 | 53 | 54 | if __name__ == "__main__": 55 | unittest.main() 56 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/generation/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .version import ( 5 | PROFILE_VERSION_DEFAULT, 6 | PROFILE_VERSIONS, 7 | ) 8 | from .configuration import ( 9 | BuildConfiguration, 10 | BUILD_CONFIGURATIONS, 11 | BUILD_VARIANT_FILTERERS, 12 | ) 13 | from .beautifiers import ( 14 | SEPARATOR_COLORSPACE_NAME, 15 | SEPARATOR_COLORSPACE_FAMILY, 16 | SEPARATOR_BUILTIN_TRANSFORM_NAME, 17 | PATTERNS_COLORSPACE_NAME, 18 | PATTERNS_LOOK_NAME, 19 | PATTERNS_TRANSFORM_FAMILY, 20 | PATTERNS_VIEW_TRANSFORM_NAME, 21 | PATTERNS_DISPLAY_NAME, 22 | PATTERNS_ALIAS, 23 | beautify_name, 24 | beautify_colorspace_name, 25 | beautify_look_name, 26 | beautify_transform_family, 27 | beautify_view_transform_name, 28 | beautify_display_name, 29 | beautify_alias, 30 | ) 31 | from .factories import ( 32 | BUILTIN_TRANSFORMS, 33 | group_transform_factory, 34 | colorspace_factory, 35 | named_transform_factory, 36 | view_transform_factory, 37 | look_factory, 38 | TRANSFORM_FACTORIES, 39 | transform_factory, 40 | produce_transform, 41 | ) 42 | from .common import ( 43 | ConfigData, 44 | deserialize_config_data, 45 | serialize_config_data, 46 | validate_config, 47 | generate_config, 48 | ) 49 | 50 | __all__ = [ 51 | "PROFILE_VERSION_DEFAULT", 52 | "PROFILE_VERSIONS", 53 | ] 54 | __all__ += [ 55 | "BuildConfiguration", 56 | "BUILD_CONFIGURATIONS", 57 | "BUILD_VARIANT_FILTERERS", 58 | ] 59 | __all__ += [ 60 | "SEPARATOR_COLORSPACE_NAME", 61 | "SEPARATOR_COLORSPACE_FAMILY", 62 | "SEPARATOR_BUILTIN_TRANSFORM_NAME", 63 | "PATTERNS_COLORSPACE_NAME", 64 | "PATTERNS_LOOK_NAME", 65 | "PATTERNS_TRANSFORM_FAMILY", 66 | "PATTERNS_VIEW_TRANSFORM_NAME", 67 | "PATTERNS_DISPLAY_NAME", 68 | "PATTERNS_ALIAS", 69 | "beautify_name", 70 | "beautify_colorspace_name", 71 | "beautify_look_name", 72 | "beautify_transform_family", 73 | "beautify_view_transform_name", 74 | "beautify_display_name", 75 | "beautify_alias", 76 | ] 77 | __all__ += [ 78 | "BUILTIN_TRANSFORMS", 79 | "group_transform_factory", 80 | "colorspace_factory", 81 | "named_transform_factory", 82 | "view_transform_factory", 83 | "look_factory", 84 | "TRANSFORM_FACTORIES", 85 | "transform_factory", 86 | "produce_transform", 87 | ] 88 | __all__ += [ 89 | "ConfigData", 90 | "deserialize_config_data", 91 | "serialize_config_data", 92 | "validate_config", 93 | "generate_config", 94 | ] 95 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/generation/configuration.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | OpenColorIO Config Build Configuration 5 | ====================================== 6 | 7 | Defines various objects related to *OpenColorIO* config build configuration: 8 | 9 | - :attr:`opencolorio_config_aces.BuildConfiguration` 10 | - :attr:`opencolorio_config_aces.BUILD_CONFIGURATIONS` 11 | - :attr:`opencolorio_config_aces.BUILD_VARIANT_FILTERERS` 12 | """ 13 | 14 | from dataclasses import dataclass, field 15 | 16 | from semver import Version 17 | 18 | from opencolorio_config_aces.config.generation import PROFILE_VERSION_DEFAULT 19 | from opencolorio_config_aces.utilities import slugify 20 | 21 | __author__ = "OpenColorIO Contributors" 22 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 23 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 24 | __maintainer__ = "OpenColorIO Contributors" 25 | __email__ = "ocio-dev@lists.aswf.io" 26 | __status__ = "Production" 27 | 28 | __all__ = ["BuildConfiguration", "BUILD_CONFIGURATIONS", "BUILD_VARIANT_FILTERERS"] 29 | 30 | 31 | @dataclass 32 | class BuildConfiguration: 33 | """ 34 | Define an *OpenColorIO* config build configuration. 35 | 36 | Parameters 37 | ---------- 38 | aces : :class:`semver.Version`, optional 39 | *aces-dev* version. 40 | colorspaces : :class:`semver.Version`, optional 41 | *OpenColorIO* colorspaces version. 42 | ocio : :class:`semver.Version`, optional 43 | *OpenColorIO* profile version. 44 | variant : str, optional 45 | Config variant, introduced to support ACES 2.0 to partition the D60 46 | views from the D65 views. 47 | """ 48 | 49 | aces: Version = field(default_factory=lambda: Version(0)) 50 | colorspaces: Version = field(default_factory=lambda: Version(0)) 51 | ocio: Version = field(default_factory=lambda: PROFILE_VERSION_DEFAULT) 52 | variant: str = field(default_factory=lambda: "") 53 | 54 | def compact_fields(self): 55 | """ 56 | Return the compact fields. 57 | 58 | Returns 59 | ------- 60 | :class:`dict` 61 | Compact fields. 62 | """ 63 | 64 | return { 65 | "aces": f"v{self.aces.major}.{self.aces.minor}", 66 | "colorspaces": f"v{self.colorspaces}", 67 | "ocio": f"v{self.ocio.major}.{self.ocio.minor}", 68 | "variant": f"{slugify(self.variant)}" if self.variant else "", 69 | } 70 | 71 | def extended_fields(self): 72 | """ 73 | Return the extended fields. 74 | 75 | Returns 76 | ------- 77 | :class:`dict` 78 | Extended fields. 79 | """ 80 | 81 | return { 82 | **self.compact_fields(), 83 | "variant": f"({self.variant})" if self.variant else "", 84 | } 85 | 86 | 87 | BUILD_CONFIGURATIONS = [ 88 | BuildConfiguration( 89 | aces=Version(2, 0), 90 | colorspaces=Version(3, 0, 0), 91 | ocio=Version(2, 4), 92 | variant="", 93 | ), 94 | BuildConfiguration( 95 | aces=Version(2, 0), 96 | colorspaces=Version(3, 0, 0), 97 | ocio=Version(2, 4), 98 | variant="D60 Views", 99 | ), 100 | BuildConfiguration( 101 | aces=Version(2, 0), 102 | colorspaces=Version(3, 0, 0), 103 | ocio=Version(2, 4), 104 | variant="All Views", 105 | ), 106 | ] 107 | """ 108 | Build configurations. 109 | 110 | BUILD_CONFIGURATIONS : list 111 | """ 112 | 113 | BUILD_VARIANT_FILTERERS = { 114 | "": { 115 | "any": {}, 116 | "all": { 117 | "view_transform_filterers": [lambda x: "D60 in" not in x["name"]], 118 | "shared_view_filterers": [lambda x: "D60 in" not in x["view_transform"]], 119 | "view_filterers": [lambda x: "D60 in" not in x["view"]], 120 | }, 121 | }, 122 | "D60 Views": { 123 | "any": {}, 124 | "all": { 125 | "view_transform_filterers": [ 126 | lambda x: "D60 in" in x["name"] 127 | or x["name"] == "Un-tone-mapped" 128 | or x["name"] == "Raw" 129 | ], 130 | "shared_view_filterers": [ 131 | lambda x: "D60 in" in x["view_transform"] 132 | or x["view_transform"] == "Un-tone-mapped" 133 | or x["view_transform"] == "Raw" 134 | ], 135 | "view_filterers": [ 136 | lambda x: "D60 in" in x["view"] 137 | or x["view"] == "Un-tone-mapped" 138 | or x["view"] == "Raw" 139 | ], 140 | }, 141 | }, 142 | "All Views": {"any": {}, "all": {}}, 143 | } 144 | """ 145 | Build variant filterers. 146 | 147 | BUILD_VARIANT_FILTERERS : dict 148 | """ 149 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/generation/version.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | OpenColorIO Config Version Utilities 5 | ==================================== 6 | 7 | Defines various objects related to *OpenColorIO* config version handling: 8 | 9 | - :attr:`opencolorio_config_aces.PROFILE_VERSION_DEFAULT` 10 | - :attr:`opencolorio_config_aces.PROFILE_VERSIONS` 11 | """ 12 | 13 | from semver import Version 14 | 15 | __author__ = "OpenColorIO Contributors" 16 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 17 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 18 | __maintainer__ = "OpenColorIO Contributors" 19 | __email__ = "ocio-dev@lists.aswf.io" 20 | __status__ = "Production" 21 | 22 | __all__ = [ 23 | "PROFILE_VERSION_DEFAULT", 24 | "PROFILE_VERSIONS", 25 | ] 26 | 27 | 28 | PROFILE_VERSION_DEFAULT = Version(2, 0) 29 | """ 30 | Default *OpenColorIO* profile version. 31 | 32 | PROFILE_VERSION_DEFAULT : Version 33 | """ 34 | 35 | PROFILE_VERSIONS = [Version(i, j) for i in range(2, 3) for j in range(1, 5)] 36 | 37 | """ 38 | *OpenColorIO* profile versions. 39 | 40 | PROFILE_VERSIONS : list 41 | """ 42 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/reference/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .discover import ( 5 | version_aces_dev, 6 | discover_aces_ctl_transforms, 7 | classify_aces_ctl_transforms, 8 | unclassify_ctl_transforms, 9 | filter_ctl_transforms, 10 | generate_amf_components, 11 | print_aces_taxonomy, 12 | build_aces_conversion_graph, 13 | node_to_ctl_transform, 14 | ctl_transform_to_node, 15 | filter_nodes, 16 | conversion_path, 17 | plot_aces_conversion_graph, 18 | ) 19 | from .generate import ( 20 | DescriptionStyle, 21 | generate_config_aces, 22 | ) 23 | 24 | __all__ = [ 25 | "version_aces_dev", 26 | "discover_aces_ctl_transforms", 27 | "classify_aces_ctl_transforms", 28 | "unclassify_ctl_transforms", 29 | "filter_ctl_transforms", 30 | "generate_amf_components", 31 | "print_aces_taxonomy", 32 | "build_aces_conversion_graph", 33 | "node_to_ctl_transform", 34 | "ctl_transform_to_node", 35 | "filter_nodes", 36 | "conversion_path", 37 | "plot_aces_conversion_graph", 38 | ] 39 | __all__ += [ 40 | "DescriptionStyle", 41 | "generate_config_aces", 42 | ] 43 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/reference/discover/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .classify import ( 5 | version_aces_dev, 6 | discover_aces_ctl_transforms, 7 | classify_aces_ctl_transforms, 8 | unclassify_ctl_transforms, 9 | filter_ctl_transforms, 10 | generate_amf_components, 11 | print_aces_taxonomy, 12 | ) 13 | from .graph import ( 14 | build_aces_conversion_graph, 15 | node_to_ctl_transform, 16 | ctl_transform_to_node, 17 | filter_nodes, 18 | conversion_path, 19 | plot_aces_conversion_graph, 20 | ) 21 | 22 | __all__ = [ 23 | "version_aces_dev", 24 | "discover_aces_ctl_transforms", 25 | "classify_aces_ctl_transforms", 26 | "unclassify_ctl_transforms", 27 | "filter_ctl_transforms", 28 | "generate_amf_components", 29 | "print_aces_taxonomy", 30 | ] 31 | __all__ += [ 32 | "build_aces_conversion_graph", 33 | "node_to_ctl_transform", 34 | "ctl_transform_to_node", 35 | "filter_nodes", 36 | "conversion_path", 37 | "plot_aces_conversion_graph", 38 | ] 39 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/reference/discover/resources/ACES_AMF_Components.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "schema_version": "1.0.0" 4 | }, 5 | "amf_components": { 6 | "urn:ampas:aces:transformId:v1.5:ACEScsc.Academy.BMDFilm_WideGamut_Gen5_to_ACES.a1.v1": [ 7 | "urn:ampas:aces:transformId:v2.0:CSC.Blackmagic.BMDFilm_WideGamut_Gen5_to_ACES.a2.v1" 8 | ], 9 | "urn:ampas:aces:transformId:v1.5:ACEScsc.Academy.LogC_EI800_AWG_to_ACES.a1.1.0": [ 10 | "urn:ampas:aces:transformId:v2.0:CSC.Arri.LogCv3_to_ACES.a2.v1" 11 | ], 12 | "urn:ampas:aces:transformId:v1.5:ACEScsc.Academy.SLog3_SGamut3_to_ACES.a1.1.0": [ 13 | "urn:ampas:aces:transformId:v2.0:CSC.Sony.SLog3_SGamut3_to_ACES.a2.v1" 14 | ], 15 | "urn:ampas:aces:transformId:v1.5:ACEScsc.Academy.SLog3_SGamut3Cine_to_ACES.a1.1.0": [ 16 | "urn:ampas:aces:transformId:v2.0:CSC.Sony.SLog3_SGamut3Cine_to_ACES.a2.v1" 17 | ], 18 | "urn:ampas:aces:transformId:v1.5:ACEScsc.Academy.SLog3_Venice_SGamut3_to_ACES.a1.1.0": [ 19 | "urn:ampas:aces:transformId:v2.0:CSC.Sony.Venice_SLog3_SGamut3_to_ACES.a2.v1" 20 | ], 21 | "urn:ampas:aces:transformId:v1.5:ACEScsc.Academy.SLog3_Venice_SGamut3Cine_to_ACES.a1.1.0": [ 22 | "urn:ampas:aces:transformId:v2.0:CSC.Sony.Venice_SLog3_SGamut3Cine_to_ACES.a2.v1" 23 | ], 24 | // Not a published "ACEStransformID" but was approved by "Graeme Natress" 25 | // during private discussions with "Carol Payne" and "Doug Walker" in March 2022. 26 | "urn:ampas:aces:transformId:v1.5:ACEScsc.Academy.Log3G10_RWG_to_ACES.a1.1.0": [ 27 | "urn:ampas:aces:transformId:v2.0:CSC.Red.Log3G10_RWG_to_ACES.a2.v1" 28 | ], 29 | // The related "ACEStransformID" is not in "aces-dev" but available online 30 | // in the following "IDT" : https://pro-av.panasonic.net/en/\ 31 | // cinema_camera_varicam_eva/support/download_data/\ 32 | // idt_panasonic_forV35_ver100.zip 33 | "urn:ampas:aces:transformId:v2.0:CSC.Panasonic.VLog_VGamut_to_ACES.a2.v1": [ 34 | "urn:ampas:aces:transformId:v1.5:IDT.Panasonic.VLog_VGamut.a1.v1" 35 | ], 36 | // The related "ACEStransformID" are not yet in "aces-dev" but pending in 37 | // a pull request: https://github.com/ampas/aces-dev/pull/137 38 | "urn:ampas:aces:transformId:v2.0:CSC.Arri.LogCv4_to_ACES.a2.v1": [ 39 | "urn:ampas:aces:transformId:v1.5:ACEScsc.Academy.LogC4_to_ACES.a1.1.0", 40 | "urn:ampas:aces:transformId:v1.5:ACEScsc.Academy.ACES_to_LogC4.a1.1.0" 41 | ] 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/reference/generate/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .config import ( 5 | DescriptionStyle, 6 | generate_config_aces, 7 | ) 8 | 9 | __all__ = [ 10 | "DescriptionStyle", 11 | "generate_config_aces", 12 | ] 13 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/reference/generate/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/reference/generate/tests/test_resources.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | Defines the unit tests for the 5 | :mod:`opencolorio_config_aces.config.reference.generate` module resources. 6 | """ 7 | 8 | 9 | import unittest 10 | 11 | import requests 12 | 13 | from opencolorio_config_aces.config.reference.generate.config import ( 14 | PATH_TRANSFORMS_MAPPING_FILE_REFERENCE, 15 | URL_EXPORT_TRANSFORMS_MAPPING_FILE_REFERENCE, 16 | ) 17 | 18 | __author__ = "OpenColorIO Contributors" 19 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 20 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 21 | __maintainer__ = "OpenColorIO Contributors" 22 | __email__ = "ocio-dev@lists.aswf.io" 23 | __status__ = "Production" 24 | 25 | __all__ = [ 26 | "TestConfigResources", 27 | ] 28 | 29 | 30 | class TestConfigResources(unittest.TestCase): 31 | """ 32 | Define the *aces-dev* reference *OpenColorIO* config resources unit tests 33 | methods. 34 | """ 35 | 36 | def test_csv_mapping_file(self): 37 | """Test the *CSV* mapping file.""" 38 | 39 | csv_local_path = PATH_TRANSFORMS_MAPPING_FILE_REFERENCE 40 | 41 | with open(str(csv_local_path)) as csv_local_file: 42 | csv_local_content = csv_local_file.read() 43 | 44 | csv_remote_content = requests.get( 45 | URL_EXPORT_TRANSFORMS_MAPPING_FILE_REFERENCE, timeout=60 46 | ).text 47 | 48 | self.assertMultiLineEqual( 49 | "\n".join(csv_remote_content.splitlines()), 50 | "\n".join(csv_local_content.splitlines()), 51 | ) 52 | 53 | 54 | if __name__ == "__main__": 55 | unittest.main() 56 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/studio/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .generate import generate_config_studio 5 | 6 | __all__ = ["generate_config_studio"] 7 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/studio/generate/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .config import generate_config_studio 5 | 6 | __all__ = ["generate_config_studio"] 7 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/studio/generate/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | -------------------------------------------------------------------------------- /opencolorio_config_aces/config/studio/generate/tests/test_resources.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | Defines the unit tests for the 5 | :mod:`opencolorio_config_aces.config.studio.generate` module resources. 6 | """ 7 | 8 | 9 | import unittest 10 | 11 | import requests 12 | 13 | from opencolorio_config_aces.config.studio.generate.config import ( 14 | PATH_TRANSFORMS_MAPPING_FILE_STUDIO, 15 | URL_EXPORT_TRANSFORMS_MAPPING_FILE_STUDIO, 16 | ) 17 | 18 | __author__ = "OpenColorIO Contributors" 19 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 20 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 21 | __maintainer__ = "OpenColorIO Contributors" 22 | __email__ = "ocio-dev@lists.aswf.io" 23 | __status__ = "Production" 24 | 25 | __all__ = [ 26 | "TestConfigResources", 27 | ] 28 | 29 | 30 | class TestConfigResources(unittest.TestCase): 31 | """ 32 | Define the *ACES* Studio *OpenColorIO* config resources unit tests methods. 33 | """ 34 | 35 | def test_csv_mapping_file(self): 36 | """Test the *CSV* mapping file.""" 37 | 38 | csv_local_path = PATH_TRANSFORMS_MAPPING_FILE_STUDIO 39 | 40 | with open(str(csv_local_path)) as csv_local_file: 41 | csv_local_content = csv_local_file.read() 42 | 43 | csv_remote_content = requests.get( 44 | URL_EXPORT_TRANSFORMS_MAPPING_FILE_STUDIO, timeout=60 45 | ).text 46 | 47 | self.assertMultiLineEqual( 48 | "\n".join(csv_remote_content.splitlines()), 49 | "\n".join(csv_local_content.splitlines()), 50 | ) 51 | 52 | 53 | if __name__ == "__main__": 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /opencolorio_config_aces/utilities/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | from .common import ( 5 | ROOT_BUILD_DEFAULT, 6 | DocstringDict, 7 | first_item, 8 | common_ancestor, 9 | paths_common_ancestor, 10 | vivification, 11 | vivified_to_dict, 12 | message_box, 13 | is_colour_installed, 14 | is_jsonpickle_installed, 15 | is_networkx_installed, 16 | REQUIREMENTS_TO_CALLABLE, 17 | required, 18 | is_string, 19 | is_iterable, 20 | git_describe, 21 | matrix_3x3_to_4x4, 22 | multi_replace, 23 | validate_method, 24 | google_sheet_title, 25 | slugify, 26 | attest, 27 | timestamp, 28 | as_bool, 29 | optional, 30 | ) 31 | 32 | __all__ = [ 33 | "ROOT_BUILD_DEFAULT", 34 | "DocstringDict", 35 | "first_item", 36 | "common_ancestor", 37 | "paths_common_ancestor", 38 | "vivification", 39 | "vivified_to_dict", 40 | "message_box", 41 | "is_colour_installed", 42 | "is_jsonpickle_installed", 43 | "is_networkx_installed", 44 | "REQUIREMENTS_TO_CALLABLE", 45 | "required", 46 | "is_string", 47 | "is_iterable", 48 | "git_describe", 49 | "matrix_3x3_to_4x4", 50 | "multi_replace", 51 | "validate_method", 52 | "google_sheet_title", 53 | "slugify", 54 | "attest", 55 | "timestamp", 56 | "as_bool", 57 | "optional", 58 | ] 59 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | 4 | [project] 5 | name = "opencolorio-config-aces" 6 | version = "3.0.0" 7 | description = "OpenColorIO Configuration for ACES" 8 | readme = "README.rst" 9 | requires-python = ">=3.10,<3.14" 10 | authors = [ 11 | { name = "OpenColorIO Contributors", email = "ocio-dev@lists.aswf.io" }, 12 | ] 13 | maintainers = [ 14 | { name = "OpenColorIO Contributors", email = "ocio-dev@lists.aswf.io" }, 15 | ] 16 | license = { text = "BSD-3-Clause" } 17 | homepage = "https://www.colour-science.org/" 18 | keywords = [ 19 | "ACES", 20 | "OpenColorIO", 21 | "OCIO" 22 | ] 23 | classifiers = [ 24 | "Development Status :: 3 - Alpha", 25 | "Environment :: Console", 26 | "Intended Audience :: Developers", 27 | "Intended Audience :: Science/Research", 28 | "License :: OSI Approved", 29 | "Natural Language :: English", 30 | "Operating System :: OS Independent", 31 | "Programming Language :: Python :: 3", 32 | "Topic :: Scientific/Engineering", 33 | "Topic :: Software Development" 34 | ] 35 | dependencies = [ 36 | "opencolorio", 37 | "requests>=2,<3", 38 | "semver>=3,<4", 39 | ] 40 | 41 | # [tool.uv.sources] 42 | # opencolorio = { index = "test-pypi" } 43 | 44 | # [[tool.uv.index]] 45 | # name = "test-pypi" 46 | # url = "https://test.pypi.org/simple/" 47 | # explicit = true 48 | 49 | [project.optional-dependencies] 50 | optional = [ 51 | "colour-science>=0.4.6", 52 | "jsonpickle", 53 | "networkx", 54 | "pydot", 55 | ] 56 | docs = [ 57 | "pydata-sphinx-theme", 58 | "sphinx", 59 | ] 60 | 61 | [project.urls] 62 | Homepage = "https://opencolorio.org" 63 | Documentation = "https://opencolorio.readthedocs.io" 64 | Repository = "https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES" 65 | Issues = "https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES/issues" 66 | Changelog = "https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES/releases" 67 | 68 | [tool.uv] 69 | package = true 70 | dev-dependencies = [ 71 | "coverage", 72 | "coveralls", 73 | "hatch", 74 | "invoke", 75 | "pre-commit", 76 | "pyright", 77 | "pytest", 78 | "pytest-cov", 79 | "pytest-xdist", 80 | ] 81 | 82 | [build-system] 83 | requires = ["hatchling"] 84 | build-backend = "hatchling.build" 85 | 86 | [tool.hatch.build.targets.wheel] 87 | packages = [ "opencolorio_config_aces" ] 88 | 89 | [tool.flynt] 90 | line_length = 999 91 | 92 | [tool.isort] 93 | ensure_newline_before_comments = true 94 | force_grid_wrap = 0 95 | include_trailing_comma = true 96 | line_length = 88 97 | multi_line_output = 3 98 | skip = ["__init__.py"] 99 | split_on_trailing_comma = true 100 | use_parentheses = true 101 | 102 | [tool.pyright] 103 | reportMissingImports = false 104 | reportMissingModuleSource = false 105 | reportUnboundVariable = false 106 | reportUnnecessaryCast = true 107 | reportUnnecessaryTypeIgnoreComment = true 108 | reportUnsupportedDunderAll = false 109 | reportUnusedExpression = false 110 | exclude = ["**/aces-dev"] 111 | 112 | [tool.ruff] 113 | target-version = "py310" 114 | line-length = 88 115 | select = [ 116 | "A", # flake8-builtins 117 | "ARG", # flake8-unused-arguments 118 | # "ANN", # flake8-annotations 119 | "B", # flake8-bugbear 120 | # "BLE", # flake8-blind-except 121 | "C4", # flake8-comprehensions 122 | # "C90", # mccabe 123 | # "COM", # flake8-commas 124 | "DTZ", # flake8-datetimez 125 | "D", # pydocstyle 126 | "E", # pydocstyle 127 | # "ERA", # eradicate 128 | # "EM", # flake8-errmsg 129 | "EXE", # flake8-executable 130 | "F", # flake8 131 | # "FBT", # flake8-boolean-trap 132 | "G", # flake8-logging-format 133 | "I", # isort 134 | "ICN", # flake8-import-conventions 135 | "INP", # flake8-no-pep420 136 | "ISC", # flake8-implicit-str-concat 137 | "N", # pep8-naming 138 | # "PD", # pandas-vet 139 | "PIE", # flake8-pie 140 | "PGH", # pygrep-hooks 141 | "PL", # pylint 142 | # "PT", # flake8-pytest-style 143 | # "PTH", # flake8-use-pathlib [Enable] 144 | "Q", # flake8-quotes 145 | "RET", # flake8-return 146 | "RUF", # Ruff 147 | "S", # flake8-bandit 148 | "SIM", # flake8-simplify 149 | "T10", # flake8-debugger 150 | "T20", # flake8-print 151 | # "TCH", # flake8-type-checking 152 | "TID", # flake8-tidy-imports 153 | "TRY", # tryceratops 154 | "UP", # pyupgrade 155 | "W", # pydocstyle 156 | "YTT", # flake8-2020 157 | ] 158 | ignore = [ 159 | "B008", 160 | "B905", 161 | "D104", 162 | "D200", 163 | "D202", 164 | "D205", 165 | "D301", 166 | "D400", 167 | "I001", 168 | "N801", 169 | "N802", 170 | "N803", 171 | "N806", 172 | "N813", 173 | "N815", 174 | "N816", 175 | "PGH003", 176 | "PIE804", 177 | "PLE0605", 178 | "PLR0911", 179 | "PLR0912", 180 | "PLR0913", 181 | "PLR0915", 182 | "PLR2004", 183 | "RET504", 184 | "RET505", 185 | "RET506", 186 | "RET507", 187 | "RET508", 188 | "TRY003", 189 | "TRY300", 190 | "UP038", 191 | ] 192 | fixable = ["B", "C", "E", "F", "PIE", "RUF", "SIM", "UP", "W"] 193 | 194 | [tool.ruff.pydocstyle] 195 | convention = "numpy" 196 | 197 | [tool.ruff.per-file-ignores] 198 | "docs/*" = ["INP"] 199 | "tasks.py" = ["INP"] 200 | "utilities/*" = ["EXE001", "INP"] 201 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by uv via the following command: 2 | # uv export --no-hashes --all-extras 3 | accessible-pygments==0.0.5 4 | alabaster==1.0.0 5 | anyio==4.8.0 6 | babel==2.17.0 7 | backports-tarfile==1.2.0 ; python_full_version < '3.12' 8 | beautifulsoup4==4.13.3 9 | certifi==2025.1.31 10 | cffi==1.17.1 ; platform_python_implementation == 'PyPy' or sys_platform == 'linux' 11 | cfgv==3.4.0 12 | charset-normalizer==3.4.1 13 | click==8.1.8 14 | colorama==0.4.6 ; sys_platform == 'win32' 15 | colour-science==0.4.6 16 | coverage==7.6.12 17 | coveralls==4.0.1 18 | cryptography==44.0.2 ; sys_platform == 'linux' 19 | distlib==0.3.9 20 | docopt==0.6.2 21 | docutils==0.21.2 22 | exceptiongroup==1.2.2 ; python_full_version < '3.11' 23 | execnet==2.1.1 24 | filelock==3.18.0 25 | h11==0.14.0 26 | hatch==1.14.0 27 | hatchling==1.27.0 28 | httpcore==1.0.7 29 | httpx==0.28.1 30 | hyperlink==21.0.0 31 | identify==2.6.9 32 | idna==3.10 33 | imageio==2.37.0 34 | imagesize==1.4.1 35 | importlib-metadata==8.6.1 ; python_full_version < '3.12' 36 | iniconfig==2.0.0 37 | invoke==2.2.0 38 | jaraco-classes==3.4.0 39 | jaraco-context==6.0.1 40 | jaraco-functools==4.1.0 41 | jeepney==0.9.0 ; sys_platform == 'linux' 42 | jinja2==3.1.6 43 | jsonpickle==4.0.2 44 | keyring==25.6.0 45 | markdown-it-py==3.0.0 46 | markupsafe==3.0.2 47 | mdurl==0.1.2 48 | more-itertools==10.6.0 49 | networkx==3.4.2 50 | nodeenv==1.9.1 51 | numpy==2.2.3 52 | opencolorio==2.4.1 53 | packaging==24.2 54 | pathspec==0.12.1 55 | pexpect==4.9.0 56 | pillow==11.1.0 57 | platformdirs==4.3.6 58 | pluggy==1.5.0 59 | pre-commit==4.1.0 60 | ptyprocess==0.7.0 61 | pycparser==2.22 ; platform_python_implementation == 'PyPy' or sys_platform == 'linux' 62 | pydata-sphinx-theme==0.16.1 63 | pydot==3.0.4 64 | pygments==2.19.1 65 | pyparsing==3.2.1 66 | pyright==1.1.396 67 | pytest==8.3.5 68 | pytest-cov==6.0.0 69 | pytest-xdist==3.6.1 70 | pywin32-ctypes==0.2.3 ; sys_platform == 'win32' 71 | pyyaml==6.0.2 72 | requests==2.32.3 73 | rich==13.9.4 74 | scipy==1.15.2 75 | secretstorage==3.3.3 ; sys_platform == 'linux' 76 | semver==3.0.4 77 | shellingham==1.5.4 78 | sniffio==1.3.1 79 | snowballstemmer==2.2.0 80 | soupsieve==2.6 81 | sphinx==8.1.3 82 | sphinxcontrib-applehelp==2.0.0 83 | sphinxcontrib-devhelp==2.0.0 84 | sphinxcontrib-htmlhelp==2.1.0 85 | sphinxcontrib-jsmath==1.0.1 86 | sphinxcontrib-qthelp==2.0.0 87 | sphinxcontrib-serializinghtml==2.0.0 88 | tomli==2.2.1 ; python_full_version <= '3.11' 89 | tomli-w==1.2.0 90 | tomlkit==0.13.2 91 | trove-classifiers==2025.3.13.13 92 | typing-extensions==4.12.2 93 | urllib3==2.3.0 94 | userpath==1.9.2 95 | uv==0.6.6 96 | virtualenv==20.29.3 97 | zipp==3.21.0 ; python_full_version < '3.12' 98 | zstandard==0.23.0 99 | -------------------------------------------------------------------------------- /utilities/resources/texlive.profile: -------------------------------------------------------------------------------- 1 | # texlive.profile written on Sun Oct 11 10:00:00 2020 UTC 2 | # It will NOT be updated and reflects only the 3 | # installation profile at installation time. 4 | selected_scheme scheme-small 5 | TEXDIR /usr/local/texlive/2020 6 | TEXMFCONFIG ~/.texlive2020/texmf-config 7 | TEXMFHOME ~/texmf 8 | TEXMFLOCAL /usr/local/texlive/texmf-local 9 | TEXMFSYSCONFIG /usr/local/texlive/2020/texmf-config 10 | TEXMFSYSVAR /usr/local/texlive/2020/texmf-var 11 | TEXMFVAR ~/.texlive2020/texmf-var 12 | binary_x86_64-linux 1 13 | instopt_adjustpath 1 14 | instopt_adjustrepo 1 15 | instopt_letter 0 16 | instopt_portable 0 17 | instopt_write18_restricted 1 18 | tlpdbopt_autobackup 1 19 | tlpdbopt_backupdir tlpkg/backups 20 | tlpdbopt_create_formats 1 21 | tlpdbopt_desktop_integration 1 22 | tlpdbopt_file_assocs 1 23 | tlpdbopt_generate_updmap 0 24 | tlpdbopt_install_docfiles 1 25 | tlpdbopt_install_srcfiles 1 26 | tlpdbopt_post_code 1 27 | tlpdbopt_sys_bin /usr/local/bin 28 | tlpdbopt_sys_info /usr/local/info 29 | tlpdbopt_sys_man /usr/local/man 30 | tlpdbopt_w32_multi_user 1 31 | -------------------------------------------------------------------------------- /utilities/tools/testclf/README.rst: -------------------------------------------------------------------------------- 1 | Test CLF 2 | ======== 3 | 4 | Apply a Common LUT Format (CLF) transform to input RGB data to test its 5 | accuracy. Recommended image format: OpenEXR. 6 | 7 | Usage 8 | ----- 9 | 10 | For full documentation, run: 11 | 12 | ``python testclf.py --help`` 13 | 14 | To apply a CLF to an image, run: 15 | 16 | ``python testclf.py transform.clf input.exr -o output.exr`` 17 | 18 | To apply a CLF to one or more RGB float triplets, run: 19 | 20 | ``python testclf.py transform.clf R,G,B R,G,B ...`` 21 | 22 | which will print to the shell: 23 | 24 | ``` 25 | R,G,B -> R,G,B 26 | R,G,B -> R,G,B 27 | ``` 28 | 29 | To apply a CLF inverse, add the ``-i`` or ``--inverse`` option to either 30 | command. 31 | 32 | Dependencies 33 | ------------ 34 | 35 | * Python (>=3.7) 36 | * ``pip install requirements.txt`` 37 | * Installs [numpy](https://pypi.org/project/numpy/) 38 | * Installs [opencolorio](https://pypi.org/project/opencolorio/) 39 | * Installs [imageio](https://pypi.org/project/imageio/) 40 | * ``imageio_download_bin freeimage`` 41 | * Installs [imageio FreeImage plugin](https://imageio.readthedocs.io/en/stable/_autosummary/imageio.plugins.freeimage.html) to enable OpenEXR support 42 | -------------------------------------------------------------------------------- /utilities/tools/testclf/requirements.txt: -------------------------------------------------------------------------------- 1 | imageio 2 | numpy 3 | opencolorio 4 | -------------------------------------------------------------------------------- /utilities/tools/testclf/testclf.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-3-Clause 2 | # Copyright Contributors to the OpenColorIO Project. 3 | """ 4 | Test CLF 5 | ======== 6 | 7 | CLI tool to apply a Common LUT Format (CLF) transform to input RGB data 8 | to test its accuracy. 9 | 10 | This module can also be imported and the function ``test_clf`` called 11 | to use the tool programmatically. 12 | 13 | In addition to CLF, this tool will work with any other LUT format 14 | supported by OpenColorIO, including CTF. 15 | """ 16 | 17 | import argparse 18 | import logging 19 | import sys 20 | import traceback 21 | 22 | import imageio 23 | import numpy as np 24 | import PyOpenColorIO as ocio 25 | 26 | __author__ = "OpenColorIO Contributors" 27 | __copyright__ = "Copyright Contributors to the OpenColorIO Project." 28 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" 29 | __maintainer__ = "OpenColorIO Contributors" 30 | __email__ = "ocio-dev@lists.aswf.io" 31 | __status__ = "Production" 32 | 33 | __all__ = ["test_clf"] 34 | 35 | 36 | LOGGER = logging.getLogger(__name__) 37 | 38 | 39 | def test_clf(clf_path, input_data, output_path, inverse=False): 40 | """ 41 | Apply a Common LUT Format (CLF) transform to input RGB data to test 42 | its accuracy. Recommended image format: OpenEXR. 43 | 44 | Parameters 45 | ---------- 46 | clf_path : str 47 | *CLF* transform file path. 48 | input_data : list[str] 49 | Single input image file path or one or more "," delimited RGB 50 | float triplet strings 51 | (e.g., ["1.0,0.0,0.0", "0.0,0.1,0.0", "0,0,1"]). 52 | output_path : str, optional 53 | Output image file path, required when an input image file is 54 | specified. 55 | inverse : bool, optional 56 | Whether to apply transform in the inverse direction. 57 | 58 | Raises 59 | ------ 60 | RuntimeError 61 | If the input parameters are invalid. 62 | """ 63 | output_image = False 64 | num_channels = 3 65 | 66 | if "," in input_data[0]: 67 | # Interpret as RGB array 68 | src_rgb = np.array( 69 | [list(map(float, c.split(","))) for c in input_data], 70 | dtype=np.float32, 71 | ) 72 | if not src_rgb.shape == (len(input_data), 3): 73 | raise RuntimeError( 74 | f"Invalid input array shape {src_rgb.shape}. Expected (N, 3)." 75 | ) 76 | else: 77 | # Interpret as RGB image path 78 | src_rgb = imageio.imread(input_data[0]) 79 | num_channels = src_rgb.shape[2] 80 | 81 | output_image = True 82 | if not output_path: 83 | raise RuntimeError( 84 | "Output path (-o OUTPUT, --output OUTPUT) required when input is an " 85 | "image file." 86 | ) 87 | 88 | # Create default OCIO config 89 | config = ocio.Config.CreateRaw() 90 | 91 | # Build a processor from a single transform 92 | file_tf = ocio.FileTransform( 93 | src=clf_path, 94 | interpolation=ocio.INTERP_BEST, 95 | direction=ocio.TRANSFORM_DIR_INVERSE if inverse else ocio.TRANSFORM_DIR_FORWARD, 96 | ) 97 | proc = config.getProcessor(file_tf) 98 | cpu_proc = proc.getDefaultCPUProcessor() 99 | 100 | # Apply file transform to a copy of src pixels in-place. Preserve src for 101 | # comparison. 102 | dst_rgb = np.copy(src_rgb) 103 | 104 | if num_channels == 4: 105 | cpu_proc.applyRGBA(dst_rgb) 106 | elif num_channels == 3: 107 | cpu_proc.applyRGB(dst_rgb) 108 | else: 109 | raise RuntimeError( 110 | f"Unsupported number of channels ({num_channels}) in input data. Image " 111 | f"must be RGB (3) or RGBA (4)." 112 | ) 113 | 114 | if output_image: 115 | # Write array to output image 116 | imageio.imwrite(output_path, dst_rgb) 117 | else: 118 | # Print pixel transformations 119 | for src_pixel, dst_pixel in zip(src_rgb, dst_rgb): 120 | logging.info( 121 | "%s -> %s", 122 | ", ".join(map(str, src_pixel)), 123 | ", ".join(map(str, dst_pixel)), 124 | ) 125 | 126 | 127 | if __name__ == "__main__": 128 | logging.basicConfig() 129 | logging.getLogger().setLevel(logging.INFO) 130 | 131 | # Tool interface 132 | parser = argparse.ArgumentParser( 133 | description="Apply a Common LUT Format (CLF) transform to input RGB data to " 134 | "test its accuracy. Recommended image format: OpenEXR." 135 | ) 136 | parser.add_argument( 137 | "clf", 138 | type=str, 139 | help="CLF transform file.", 140 | ) 141 | parser.add_argument( 142 | "input", 143 | type=str, 144 | nargs="+", 145 | help="Input image file or one or more ',' delimited RGB float triplets " 146 | "(e.g., 1.0,0.0,0.0 0.0,0.1,0.0 0,0,1).", 147 | ) 148 | parser.add_argument( 149 | "-o", 150 | "--output", 151 | type=str, 152 | help="Output image file, required when an input image file is specified.", 153 | ) 154 | parser.add_argument( 155 | "-i", 156 | "--inverse", 157 | action="store_true", 158 | help="Apply transform in the inverse direction.", 159 | ) 160 | 161 | # Parse arguments 162 | args = parser.parse_args() 163 | 164 | # Run tool and exit 165 | exit_code = 1 166 | 167 | try: 168 | test_clf(args.clf, args.input, args.output, args.inverse) 169 | exit_code = 0 170 | except Exception as e: 171 | traceback.print_exc() 172 | logging.info("An error occurred: %s", e) 173 | 174 | sys.exit(exit_code) 175 | --------------------------------------------------------------------------------