-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
[OCIO] Pure black (0.0,0.0,0.0) and near values get "lifted", compared to original main-AgX (ociov2) version. #9
Comments
Hello, thanks for reporting. I have a look and answer there on what I find. |
Also could you mention which software was used to produce the image please ? |
I did them with Nuke since it supports both OCIO v2 and v1. |
Ok found the issue. Comes from the latest AllocationTransform : Line 83 in 29653e9
I added an offset (the
Those are initially negative values or pure black values. Also added because of the explanation in the documentation : https://opencolorio.org/old/configurations/allocation_vars.html#allocationvars
But of course, I don't revert this offset after so yeah it looks wrong. What to do
|
The lack of clipping is challenging in V1. I know that a basic uniform LUT will properly clip. Even a two entry one will work if memory serves. I was unable to diagnose any other tricks to get a clip / clamp to work. |
I guess will go down that road then, seems other usual configs also use LUTs for log transforms. |
First solution attempt : - !<ColorSpace>
name: AgX Log (Kraken)
family: AgX
equalitygroup: ""
bitdepth: 32f
description: AgX Log (Kraken)
isdata: false
allocation: uniform
allocationvars: [ -12.47393, 4.026069 ]
from_reference: !<GroupTransform>
children:
# the 3 bottom transforms are used only as a hack to clamp negatives
- !<AllocationTransform> { allocation: lg2, vars: [ -10, 7, 0.0056065625 ] }
- !<FileTransform> { src: dummy.spi1d, interpolation: linear }
- !<AllocationTransform> { allocation: lg2, vars: [ -10, 7, 0.0056065625 ], direction: inverse }
- !<MatrixTransform> { matrix: [ 0.842479062253094, 0.0784335999999992, 0.0792237451477643, 0, 0.0423282422610123, 0.878468636469772, 0.0791661274605434, 0, 0.0423756549057051, 0.0784336, 0.879142973793104, 0, 0, 0, 0, 1 ] }
- !<AllocationTransform> { allocation: lg2, vars: [ -12.47393, 4.026069] }
- !<FileTransform> { src: dummy.spi1d, interpolation: linear } Just reusing the same dummy lut I used pre-log to clamp post-log. Seems to work fine but I still have a small difference with the default AgX implementation. |
Most of the technical aspects of this escape me almost completely, so all I can add to the topic from here on is from the perspective of an end-user who just cares about this aestethically/artistically in a close to whatever-works kind of way, and honestly doesn't mind pixel-perfect accuracy (it's just a nice-to-know or "be adviced" that some discrepancies are there). As I was telling another friend who's also interested in getting a functional version of AgX for software that hasn't updated to OCIO v2 yet: If this problem proves to be unsolvable (or very hard/annoying to fix) I'm personally OK with just using this config as is even prior to all the changes on this isssue, and just grading on top of the minor discrepancies (like I would grade using main-AgX anyways too so it's not really a change in my workflow, just some extra considerations for what I initially described as a "lift" on blacks). Just to test further and to see the differences on a real case scenario rather than test images of swatches and such, I grabbed an exr from an old piece of mine and pass it through Nuke + AgX main (OCIOv2) and Affinity + AgX fork (OCIOv1), and then did grading to both in their respective softwares, here are the results: EXR loaded to Nuke with OCIO v2, main AgX base by Troy as the view-transform, no grading: EXR loaded to Affinity Photo 2 with OCIO v1, forked AgX base by Liam as the view-transform, no grading: In this ungraded versions we can see the minor difference of the dark areas being sligtly "lifted" on the later one as we saw on the other tests. Now l did grading to each of them: Nuke OCIO v2 AgX main + Grading Affinity Photo 2 OCIO v1 AgX fork + Grading Here them not beign 100%/1:1 identical it's mostly due to the fact that I don't have the exact same grading tools in both sofwares, but for all intents and purposes I care about, they both work the same and that difference from the ungraded versions is gone. And to test further: same exr (no grading), +5 stops of exposure, with AgX main OCIOv2 as view transform, on Nuke: same exr (no grading), +5 stops of exposure, with AgX fork OCIOv1 as view transform, on Affinity Photo 2: Again showing very minor differences of the same order. |
Thanks for taking further time to test, that's cool ! For now, I have a solution that fix the blacks as mentioned above. But it still doesn't handle negative values properly. Negative values fall into a deep topic that I'm not enough familiar with to properly know how to handle them. But anyway in the end I will have a fix that at least doesn't destroy the pure black values. |
I think that the LUT was the only way to get a clip in, but I have put out a seance table with the hope of bridging to the Dark Underworld and summoning the High Priest of Colour Netherworld to confirm. His wisdom dwarfs mere mortals, so hopefully he will appear… It is funny how almost everything comes back to invalid signals. Short term hack would be to bookend the result with the LUT hack? |
I hope the invocation doesn't imply too much sacrifices haha. I don't get fully the "bookend", I can't use the LUT clip hack before because well I have to use Right now I can use it after the log2 transform, which indeed clip negatives, but I still have artefact from the pre negatives that were not clipped ... You can check the implementation I have right now in |
The values that are outside of the chromaticity footprint of BT.709 are negative. This needs to happen before the conversion to the log encoding, if I am reading you correctly. Only meaningful values can exist in the normalized log encoding, and with a normalized log encoding, minimum to maximum are mapped zero to one. Using the idea of a normalized log, it would seem impossible to generate negatives. |
Awesome, I just tried the updated config doing the same "diff pass" test as I did on the original post and now it's zeros all around on my end too, 1:1 match, looking fine on Affinity as well Should I hit that "Close issue" button down here? Sorry I'm not very GitHub savvy. |
@sobotka hey, Sounds like what I get yes I consider the initial issue fixed but there is still one on negatives. So I opened a new issue #11 to track it. Feel free to move on to this issue if you want to continue the conversation. Thanks to both of you for the involvement ! |
Hi, I have been trying this config looking for a v1 compatible version of AgX. Troubleshooting it with Troy we found some interesting inconsistencies between this version and his original OCIOv2 one.
Here are some examples (made with this test image):
Image viewed with Troy's original main AgX (OCIO v2)
Image viewed with this v1 compatible fork:
Delta/difference pass between both:
Same diff pass as above, but gain-boosted for clarity:
Here is the analisys of a single pixel that is pure 0.0, 0.0, 0.0 on the original file, and remains like that with Troy's original config (bottom read), but gets lifted to 0.06219 on this fork (top read)
So it seems the changes in appearance are the strongest at pure black values and fade out from near there to higher values.
In grading, a simple "offset" doesn't fix it. A black-point re-map seems to get quite close to a perfect match, but non-uniformly (matching an area of the image gets another area further away, and so on). So it seems like a nuanced change on the "toe" of it?
He suspects is something about the allocation variables or MatrixTransform.
I understand there is a disclaimer on the fork description about them not being 100% garanteed in accuracy, but maybe this is a useful insight, since that "lift" is kinda weird.
Cheers!
The text was updated successfully, but these errors were encountered: