-
Notifications
You must be signed in to change notification settings - Fork 43
PR: 2025-09 #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
KelSolaar
merged 17 commits into
AcademySoftwareFoundation:main
from
colour-science:feature/2025-09
Oct 2, 2025
Merged
PR: 2025-09 #160
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2eba014
Use `https://github.com/ampas/aces`and fix old `ACEStransformID` for …
KelSolaar b136185
Enable *Rec.709* *Gamma 2.2* display rendering transforms.
KelSolaar b9a5b5e
Implement support for *DJI D-Log - D-Gamut*.
KelSolaar 6aee030
Prepare ground for *AMF* updates.
KelSolaar 2f86e97
Implement support for adding virtual displays.
KelSolaar 380cf02
Implement support for `interop_id` and new mirrored display builtins …
KelSolaar e9e1b2a
Implement support for `amf_transform_ids`.
KelSolaar 9fccca1
Address various code review notes.
KelSolaar 71c64e9
Implement support for viewing rules.
KelSolaar 2f75f84
Implement support for file rules.
KelSolaar bb25a66
Bump *colorspaces* version to 4.0.0.
KelSolaar 827208f
Implement support for *AMF* components filtering by config variant.
KelSolaar 9756e95
Add *AMF* component IDs to *Look* and *ViewTransform*.
KelSolaar 204e3e8
Update CSV files.
KelSolaar e54faa0
Use `https://github.com/scottdyer/aces` remote `arri-csc-aces-to-logC…
KelSolaar 89932e2
Update viewing rules.
KelSolaar 2c36aeb
Ensure that there are no empty *ACEStransformID* in the *AMF* compone…
KelSolaar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| [submodule "opencolorio_config_aces/config/reference/aces-system"] | ||
| path = opencolorio_config_aces/config/reference/aces-system | ||
| url = https://github.com/colour-science/aces-system | ||
| [submodule "opencolorio_config_aces/config/reference/aces"] | ||
| path = opencolorio_config_aces/config/reference/aces | ||
| url = https://github.com/ampas/aces |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,3 +40,5 @@ Common | |
| timestamp | ||
| as_bool | ||
| optional | ||
| filter_any | ||
| filter_all | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
| # Copyright Contributors to the OpenColorIO Project. | ||
|
|
||
| from .generate import ( | ||
| generate_clf_transforms_dji, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "generate_clf_transforms_dji", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,173 @@ | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
| # Copyright Contributors to the OpenColorIO Project. | ||
| """ | ||
| *DJI* CLF Transforms Generation | ||
| ================================ | ||
|
|
||
| Defines procedures for generating DJI *Common LUT Format* (CLF) | ||
| transforms: | ||
|
|
||
| - :func:`opencolorio_config_aces.clf.generate_clf_transforms_dji` | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| import PyOpenColorIO as ocio | ||
|
|
||
| from opencolorio_config_aces.clf.transforms import ( | ||
| clf_basename, | ||
| format_clf_transform_id, | ||
| generate_clf_transform, | ||
| matrix_RGB_to_RGB_transform, | ||
| ) | ||
| from opencolorio_config_aces.config import transform_factory | ||
|
|
||
| __author__ = "OpenColorIO Contributors" | ||
| __copyright__ = "Copyright Contributors to the OpenColorIO Project." | ||
| __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" | ||
| __maintainer__ = "OpenColorIO Contributors" | ||
| __email__ = "ocio-dev@lists.aswf.io" | ||
| __status__ = "Production" | ||
|
|
||
| __all__ = [ | ||
| "FAMILY", | ||
| "GENUS", | ||
| "VERSION", | ||
| "generate_clf_transforms_dji", | ||
| ] | ||
|
|
||
| FAMILY: str = "DJI" | ||
| """ | ||
| *CLF* transforms family. | ||
| """ | ||
|
|
||
| GENUS: str = "Input" | ||
| """ | ||
| *CLF* transforms genus. | ||
| """ | ||
|
|
||
| VERSION: str = "1.0" | ||
| """ | ||
| *CLF* transforms version. | ||
| """ | ||
|
|
||
|
|
||
| def generate_clf_transforms_dji( | ||
| output_directory: Path, | ||
| ) -> dict[Path, ocio.GroupTransform]: | ||
| """ | ||
| Generate the *CLF* transforms for *D-Log - D-Gamut* plus matrix/curve. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| output_directory | ||
| Directory to write the *CLF* transform(s) to. | ||
|
|
||
| Returns | ||
| ------- | ||
| :class:`dict` | ||
| Dictionary of *CLF* transforms and *OpenColorIO* `GroupTransform` | ||
| instances. | ||
|
|
||
| References | ||
| ---------- | ||
| - Dji. (2017). White Paper on D-Log and D-Gamut of DJI Cinema Color | ||
| System (pp. 1-5). https://dl.djicdn.com/downloads/zenmuse+x7/20171010/\ | ||
| D-Log_D-Gamut_Whitepaper.pdf | ||
| """ | ||
|
|
||
| output_directory.mkdir(parents=True, exist_ok=True) | ||
|
|
||
| clf_transforms = {} | ||
|
|
||
| base = 10.0 | ||
|
|
||
| # Mathematically correct for transition at log = 0.14: | ||
| # lin_side_break = (0.14 - 0.0929) / 6.025 = 0.007817427385892119 | ||
| # Optimized: | ||
| lin_side_break = 0.00758078675 | ||
|
|
||
| log_side_slope = 1.0 / 3.89616 | ||
| log_side_offset = 2.27752 / 3.89616 | ||
| lin_side_slope = 0.9892 | ||
| lin_side_offset = 0.0108 | ||
|
|
||
| lct = transform_factory( | ||
| transform_type="LogCameraTransform", | ||
| transform_factory="Constructor", | ||
| base=base, | ||
| linSideBreak=[lin_side_break] * 3, | ||
| logSideSlope=[log_side_slope] * 3, | ||
| logSideOffset=[log_side_offset] * 3, | ||
| linSideSlope=[lin_side_slope] * 3, | ||
| linSideOffset=[lin_side_offset] * 3, | ||
| direction=ocio.TRANSFORM_DIR_INVERSE, | ||
| ) | ||
|
|
||
| mtx = matrix_RGB_to_RGB_transform("DJI D-Gamut", "ACES2065-1", "CAT02") | ||
|
|
||
| # ACES transform ID from the CTL file | ||
| aces_transform_id = ( | ||
| "urn:ampas:aces:transformId:v2.0:CSC.DJI.DLog_DGamut_to_ACES.a1.v1" | ||
| ) | ||
|
|
||
| # Generate full transform. | ||
| name = "DLog_DGamut_to_ACES2065-1" | ||
| input_descriptor = "DJI D-Log - D-Gamut" | ||
| output_descriptor = "ACES2065-1" | ||
| clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) | ||
| filename = output_directory / clf_basename(clf_transform_id) | ||
| clf_transforms[filename] = generate_clf_transform( | ||
| filename, | ||
| [lct, mtx], | ||
| clf_transform_id, | ||
| f"{input_descriptor} to {output_descriptor}", | ||
| input_descriptor, | ||
| output_descriptor, | ||
| aces_transform_id, | ||
| ) | ||
|
|
||
| # Generate transform for primaries only. | ||
| name = "Linear_DGamut_to_ACES2065-1" | ||
| input_descriptor = "Linear DJI D-Gamut" | ||
| output_descriptor = "ACES2065-1" | ||
| clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) | ||
| filename = output_directory / clf_basename(clf_transform_id) | ||
| clf_transforms[filename] = generate_clf_transform( | ||
| filename, | ||
| [mtx], | ||
| clf_transform_id, | ||
| f"{input_descriptor} to {output_descriptor}", | ||
| input_descriptor, | ||
| output_descriptor, | ||
| ) | ||
|
|
||
| # Generate `NamedTransform` for log curve only. | ||
| name = "DLog-Curve_to_Linear" | ||
| input_descriptor = "DJI D-Log Log (arbitrary primaries)" | ||
| output_descriptor = "DJI D-Log Linear (arbitrary primaries)" | ||
| clf_transform_id = format_clf_transform_id(FAMILY, GENUS, name, VERSION) | ||
| filename = output_directory / clf_basename(clf_transform_id) | ||
| clf_transforms[filename] = generate_clf_transform( | ||
| filename, | ||
| [lct], | ||
| clf_transform_id, | ||
| f'{input_descriptor.replace(" (arbitrary primaries)", "")} to Linear Curve', | ||
| input_descriptor, | ||
| output_descriptor, | ||
| ) | ||
|
|
||
| return clf_transforms | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| import logging | ||
|
|
||
| logging.basicConfig() | ||
| logging.getLogger().setLevel(logging.INFO) | ||
|
|
||
| output_directory = Path(__file__).parent.resolve() / "input" | ||
|
|
||
| generate_clf_transforms_dji(output_directory) | ||
8 changes: 8 additions & 0 deletions
8
opencolorio_config_aces/clf/transforms/dji/input/DJI.Input.DLog-Curve.clf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <ProcessList compCLFversion="3" id="urn:aswf:ocio:transformId:1.0:DJI:Input:DLog-Curve_to_Linear:1.0" name="DJI D-Log Log to Linear Curve"> | ||
| <InputDescriptor>DJI D-Log Log (arbitrary primaries)</InputDescriptor> | ||
| <OutputDescriptor>DJI D-Log Linear (arbitrary primaries)</OutputDescriptor> | ||
| <Log inBitDepth="32f" outBitDepth="32f" style="cameraLogToLin"> | ||
| <LogParams base="10" linSideSlope="0.9892" linSideOffset="0.0108" logSideSlope="0.256662970719888" logSideOffset="0.58455504907396" linSideBreak="0.00758078675" /> | ||
| </Log> | ||
| </ProcessList> |
18 changes: 18 additions & 0 deletions
18
opencolorio_config_aces/clf/transforms/dji/input/DJI.Input.DLog_DGamut_to_ACES2065-1.clf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <ProcessList compCLFversion="3" id="urn:aswf:ocio:transformId:1.0:DJI:Input:DLog_DGamut_to_ACES2065-1:1.0" name="DJI D-Log - D-Gamut to ACES2065-1"> | ||
| <InputDescriptor>DJI D-Log - D-Gamut</InputDescriptor> | ||
| <OutputDescriptor>ACES2065-1</OutputDescriptor> | ||
| <Info> | ||
| <ACEStransformID>urn:ampas:aces:transformId:v2.0:CSC.DJI.DLog_DGamut_to_ACES.a1.v1</ACEStransformID> | ||
| </Info> | ||
| <Log inBitDepth="32f" outBitDepth="32f" style="cameraLogToLin"> | ||
| <LogParams base="10" linSideSlope="0.9892" linSideOffset="0.0108" logSideSlope="0.256662970719888" logSideOffset="0.58455504907396" linSideBreak="0.00758078675" /> | ||
| </Log> | ||
| <Matrix inBitDepth="32f" outBitDepth="32f"> | ||
| <Array dim="3 3"> | ||
| 0.691279245585754 0.214382527745956 0.0943382266682902 | ||
| 0.0662224037667752 1.0116160801876 -0.0778384839543733 | ||
| -0.0172985410341745 -0.0773788501012682 1.09467739113544 | ||
| </Array> | ||
| </Matrix> | ||
| </ProcessList> |
12 changes: 12 additions & 0 deletions
12
opencolorio_config_aces/clf/transforms/dji/input/DJI.Input.Linear_DGamut_to_ACES2065-1.clf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <ProcessList compCLFversion="3" id="urn:aswf:ocio:transformId:1.0:DJI:Input:Linear_DGamut_to_ACES2065-1:1.0" name="Linear DJI D-Gamut to ACES2065-1"> | ||
| <InputDescriptor>Linear DJI D-Gamut</InputDescriptor> | ||
| <OutputDescriptor>ACES2065-1</OutputDescriptor> | ||
| <Matrix inBitDepth="32f" outBitDepth="32f"> | ||
| <Array dim="3 3"> | ||
| 0.691279245585754 0.214382527745956 0.0943382266682902 | ||
| 0.0662224037667752 1.0116160801876 -0.0778384839543733 | ||
| -0.0172985410341745 -0.0773788501012682 1.09467739113544 | ||
| </Array> | ||
| </Matrix> | ||
| </ProcessList> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was debating whether we should specify linearSlope or not? If we don't specify it, the slope of the extrapolated curve will be:
0.256662970719888 * 0.9892 / ( np.log(10.) * (0.9892 * 0.00758078675 + 0.0108) ) = 6.02568346
I don't object to going with what you have here, it will be quite close to the published value. Their intent was probably that the slope would be continuous.
I do like the way you used the log-to-lin as the definitive version and recalculated as needed rather than simply using the rounded values from the lin-to-log direction in their white paper!