You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- flim's 3D LUT is designed to be used in an [OpenColorIO](https://opencolorio.org/) (OCIO) environment, but depending on your software and environment, you might be able to manually replicate the transforms in your custom pipeline.
65
+
- flim's 3D LUTs are designed to be used in an [OpenColorIO](https://opencolorio.org/) (OCIO) environment, but depending on your software and environment, you might be able to manually replicate the transforms in your custom pipeline ([See Non-OCIO Guide below](#non-ocio-guide)).
60
66
61
67
- flim only supports the sRGB display format as of now.
62
68
63
-
If `main.py` runs successfully, you should see a file named `flim.spi3d` in the same directory. Alternatively, you can look up the latest LUT - no pun intended - in the [releases](https://github.com/bean-mhm/flim/releases) section, which may be outdated.
69
+
If `main.py` runs successfully, you should see files named like `flim_X.spi3d` in the same directory. Alternatively, you can look up the latest LUTs in the [releases](https://github.com/bean-mhm/flim/releases) section.
64
70
65
-
The LUT's expected input and output formats are mentioned in the LUT comments at end of the file. The following is an example of the LUT comments (note that this might not match the latest version).
71
+
The LUTcomments contain most of the information you need. The following is an example of the LUT comments (note that this might not match the latest version).
# 1. ColorSpaceTransform converts the input from the scene reference to Linear BT.709 I-D65. If this is named
108
+
# differently in your config (for example Linear Rec.709), change the name manually.
109
+
# 2. RangeTransform clips negative values. You might want to use a gamut compression algorithm before this step.
110
+
# 3. AllocationTransform is for LUT compression, it takes the log2 of the RGB values and maps them from a
111
+
# specified range (the first two values after 'vars') to [0, 1]. The third value is the offset applied to the
112
+
# values before log2. This is done to keep the blacks.
113
+
# 4. Lastly, the FileTransform references the 3D LUT and defines a trilinear interpolation method.
114
+
#
115
+
# Adding this as a view transform is pretty straightforward:
106
116
```
107
-
108
-
1. Paying attention to the transforms, you will notice a `ColorSpaceTransform` from `Linear CIE-XYZ I-E` to `Linear BT.709 I-D65`. This is because the example OCIO config has its reference color space (the `reference` role) set to `Linear CIE-XYZ I-E`. If your config already uses `Linear BT.709 I-D65` (Linear Rec.709) as its reference this is not needed. If your config uses another color space as its reference, you should manually do a conversion to `Linear BT.709 I-D65`. You can get the conversion matrices using the [Colour](https://www.colour-science.org/) library.
109
-
110
-
2. Then, we have a `RangeTransform` which is there to eliminate negative values in out-of-gamut triplets. This is not the best approach as it might cause weird transitions in images that have been converted from a wider gamut and have a lot of negative values.
111
-
112
-
3. Next, we have an `AllocationTransform` which can be directly copied from the LUT comments. The `AllocationTransform` here takes the log2 of the tristimulus (RGB) values and maps them from the specified range (the first two values after `vars`) to the [0, 1] range. The third value in `vars` is the initial offset applied to the values. This is done to keep the blacks.
113
-
114
-
4. Finally, a `FileTransform` references the 3D LUT.
115
-
116
-
Here's an example of how you can add flim as a view transform to an OCIO config:
> `...` refers to the other view transforms in the config. `...` is generally used as a placeholder for the other parts of the code. I can't believe I had to mention this, but a friend was actually confused by it.
126
133
127
134
### Non-OCIO Guide
128
135
129
-
You can replicate the transforms farily easily in order to use flim's 3D LUT in your own pipeline without using OCIO. The following pseudo-code demonstrates the general process to transform a single RGB triplet (note that this might not match the latest version).
136
+
You can replicate the transforms farily easily in order to use flim's 3D LUTs in your own pipeline without using OCIO. The following pseudo-code demonstrates the general process to transform a single RGB triplet (note that this might not match the latest version).
130
137
131
138
```py
132
139
# Input RGB values (color space: Linear BT.709 I-D65)
133
140
col = np.array([4.2, 0.23, 0.05])
134
141
135
142
# RangeTransform
136
-
# (clip negative values, or use a custom gamut compression algorithm)
143
+
#Clip negative values, or use a gamut compression algorithm.
0 commit comments