Skip to content
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

Hue vs Hue impossible in HueCorrect #610

Closed
tobiasBora opened this issue Apr 26, 2021 · 21 comments
Closed

Hue vs Hue impossible in HueCorrect #610

tobiasBora opened this issue Apr 26, 2021 · 21 comments
Labels
func:plugins info:feedback-needed Further information is requested type:feature New feature or request ver:2.x

Comments

@tobiasBora
Copy link

tobiasBora commented Apr 26, 2021

Problem

In order to do color grading, many people seem to use a "Hue vs Hue" curve modifier, in which you can change the Hue depending on the Hue. It is practical to replace a color with another color for instance, and it is demonstrated for instance in this video (for Davinci Resolve).

We are actually very close to have this functionality: there is indeed a HueCorrect node:

image

The problem is that the HueCorrect node cannot change the hue, but only the saturation/luminosity or the red/green/blue channels separately (which won't preserve the saturation and luminosity).

To see a great example, you can also see the DarkTable version of the node here, I think the interface is really nicely polished: you can even visualize on the y axis the final hue you get, move several nodes at once via a "proportional" mode, color pick... It just lacks bezier curves to be perfect, and a way to display also the y value when picking a point (like Natron already has).

image

Versions

  • Natron version/commit 2.3.15
  • OS version: NixOs unstable
@devernay
Copy link
Member

OK, this can be done, now the question is, where does the hue transform go in the chain of transforms.
You get the order of hue-based color transforms here:
https://github.com/NatronGitHub/openfx-misc/blob/0fe81c650c656436558e227f920caf487e4c51fe/HueCorrect/HueCorrect.cpp#L347

would that go before or after the red,green, blue transforms?

@devernay
Copy link
Member

Or should I just make a separate HuevsHue node?

@Echolon Echolon added func:engine func:nodegraph info:feedback-needed Further information is requested type:feature New feature or request ver:2.x labels Apr 30, 2021
@blackearth2014
Copy link
Contributor

blackearth2014 commented May 1, 2021

@devernay I would just add another panel to the HueCorrect node with the HuevsHue, HuevsSat, HuevsLuma, and LumavsSat feature set.

@tobiasBora
Copy link
Author

tobiasBora commented May 2, 2021 via email

@devernay
Copy link
Member

devernay commented May 3, 2021

I'll work on this. it has to be a separate panel, because the hue stripes have to go diagonally as in the darktable example above.

@devernay
Copy link
Member

devernay commented May 3, 2021

I think I would apply hue change first. But question: should we use the sat_thrsh, or rotate hue regardless of the saturation?

@blackearth2014
Copy link
Contributor

blackearth2014 commented May 3, 2021 via email

devernay added a commit to NatronGitHub/openfx-misc that referenced this issue May 4, 2021
@devernay
Copy link
Member

devernay commented May 5, 2021

OK I'm preparing a Linux and a Mac build for you to test. You'll note a small checkbox below the curves that draws a diffrenet guide on the background
image

@devernay
Copy link
Member

devernay commented May 5, 2021

@tobiasBora
Copy link
Author

Thank you so much for your reactivity! So I just tested it and the hue changing does work, thanks! However, I do not get like you the diagonal colors, which would be great (I'm not sure if others tabs like "sat" are supposed to also have this kind of display):

image

Thanks a lot!

@tobiasBora
Copy link
Author

tobiasBora commented May 5, 2021

Also, after playing a bit with the curves, I got a segfault, I'm not sure if it's a regression or not:

$ QT_X11_NO_MITSHM=1 ./Natron
Natron Version 2.4.1
(C) 2018-2021 The Natron developers
(C) 2013-2018 INRIA and Alexandre Gauthier-Foichat
>>>Use the --help or -h option to print usage.<<<
Py_SetPythonHome("/home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/..")
PYTHONPATH set to /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/python27.zip:/home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/python2.7:/home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../Plugins
Py_SetProgramName("/home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/Natron")
Py_Initialize()
PATH is /run/wrappers/bin:/usr/bin:/usr/sbin:/run/wrappers/bin:/home/me/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/home/me/.nix-profile/bin:/etc/profiles/per-user/leo/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:~/.emacs.d/bin
PYTHONPATH is /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/python27.zip:/home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/python2.7:/home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../Plugins
PYTHONHOME is (null)
Py_DebugFlag is 0
Py_VerboseFlag is 0
Py_InteractiveFlag is 0
Py_InspectFlag is 0
Py_OptimizeFlag is 0
Py_NoSiteFlag is 0
Py_BytesWarningFlag is 0
Py_UseClassExceptionsFlag is 1
Py_FrozenFlag is 0
Py_TabcheckFlag is 0
Py_UnicodeFlag is 0
Py_IgnoreEnvironmentFlag is 0
Py_DivisionWarningFlag is 0
Py_DontWriteBytecodeFlag is 0
Py_NoUserSiteDirectory is 1
Py_GetProgramName is /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/Natron
Py_GetPrefix is /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/..
Py_GetExecPrefix is /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/..
Py_GetProgramFullPath is /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/Natron
Py_GetPath is /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/python27.zip:/home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/python2.7:/home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../Plugins:/home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/python27.zip:/home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/python2.7:/home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/python2.7/plat-linux2:/home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/python2.7/lib-tk:/home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/python2.7/lib-old:/home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/python2.7/lib-dynload
Py_GetPythonHome is /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/..
Python library is in /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/lib/python2.7/site-packages
Info: init.py script not loaded (this is not an error)
Info: initGui.py script not loaded (this is not an error)
Loading project: /home/me/.local/share/INRIA/Natron/Autosaves/Untitled.ntp.autosave.8028438350752414769
Caught segmentation fault (SIGSEGV) from thread Global Thread (Pooled) (0x7f5de40024a8)(0x7f5de4002480), faulty address is 0x7f5e2e1a1944 from 0x7f59340210f0
Backtrace:
[Frame 1]: /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/Plugins/OFX/Natron/Misc.ofx.bundle/Contents/Linux-x86-64/Misc.ofx(+0x654944) [0x7f5e2e1a1944]
[Frame 2]: /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/Plugins/OFX/Natron/Misc.ofx.bundle/Contents/Linux-x86-64/Misc.ofx(+0x654944) [0x7f5e2e1a1944]
[Frame 3]: /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/Plugins/OFX/Natron/Misc.ofx.bundle/Contents/Linux-x86-64/Misc.ofx(+0x189918) [0x7f5e2dcd6918]
[Frame 4]: /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/Natron() [0xe3e25e]
[Frame 5]: /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/Natron(_ZN12QtConcurrent16MappedEachKernelIN9__gnu_cxx17__normal_iteratorIPKjSt6vectorIjSaIjEEEEN5boost3_bi6bind_tIiPFiPFvjjPvEjjP7QThreadSC_ENSA_5list5INSA_5valueISE_EENS9_3argILi1EEENSK_IjEENSK_ISG_EENSK_ISC_EEEEEEE13runIterationsES8_iiPi+0x51) [0xe45e81]
[Frame 6]: /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/Natron(_ZN12QtConcurrent13IterateKernelIN9__gnu_cxx17__normal_iteratorIPKjSt6vectorIjSaIjEEEEiE17forThreadFunctionEv+0x13e) [0xe4740e]
[Frame 7]: /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/Natron(_ZTv0_n56_N12QtConcurrent13IterateKernelIN9__gnu_cxx17__normal_iteratorIPKjSt6vectorIjSaIjEEEEiE14threadFunctionEv+0x26) [0xe48116]
[Frame 8]: /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/libQtCore.so.4(_ZN12QtConcurrent16ThreadEngineBase3runEv+0x4d) [0x7f5e76e25dcd]
[Frame 9]: /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/libQtCore.so.4(_ZN17QThreadPoolThread3runEv+0x7d) [0x7f5e76e27e8d]
[Frame 10]: /home/me/Natron/2.4.1-alpha1/Natron-RB-2.4-202105042326-f9f0f50-Linux-64-no-installer/bin/../lib/libQtCore.so.4(+0xa4ec3) [0x7f5e76e32ec3]
[Frame 11]: /lib64/libpthread.so.0(+0x8e9e) [0x7f5e76ce7e9e]
[Frame 12]: /lib64/libc.so.6(clone+0x3f) [0x7f5e768a855f]
terminate called without an active exception

-- EDIT --
Actually I got the segfault while playing with the sat curves (I tried to play again with it and I can't reproduce the segfault). Also, in "hue" mode, I can modify the curve anywhere (really practical), but in the sat curve, I can't edit the curve on the right side (red box), but I can edit it in the left side (green box):
image

Also, I'm not sure if it's wanted, but the handle length of the bezier curve are not editable, it's only possible to edit the tangeant direction.

@blackearth2014
Copy link
Contributor

Fred,

There are differences between the HueCorrect node from 2.4 & 2.4.1. What happens to the Alpha channel box in the 2.4.1 version?

hueCorrect 2 4

hueCorrect 2 4 1

@devernay
Copy link
Member

devernay commented May 5, 2021

@tobiasBora

I do not get like you the diagonal colors,

This is obtained by checking the "hue vs hue guide" below the curves (see @blackearth2014 snapshot just above this message). It is only useful for hue vs hue, and it is not possible to change the background automatically if you select only the hue curve.

the handle length of the bezier curve are not editable

It's not a 2D Bezier, it's just a 1D cubic curve, so only the tangent direction is editable. You can add more points if you need to (dbl-click). There is an issue about replacing 1D cubic curves with 2D Bezier, but it requires a significant amount of work to be done, and I'm not sure the added value is worth it: #346

in the sat curve, I can't edit the curve on the right side (red box), but I can edit it in the left side (green box):

Actually this is true for all curves: each control point has only one manipulator. Just look for the bullet point.

@blackearth2014 the alpha checkbox only appears if the input has an alpha channel (try ColorWheel for testing)

@devernay
Copy link
Member

devernay commented May 5, 2021

btw I forgot to mention that you can pin the yellow guide by ctrl-clicking on any point in the viewer (cmd-click on mac)

@tobiasBora
Copy link
Author

Oh really nice, thanks a lot! I guess the only problem is the segfault (hard to reproduce) and I don't think it's related to the current PR since it occured in the sat tab. I guess it's safe it to keep it in master. Thanks a lot! I guess we can close this issue?

@devernay
Copy link
Member

devernay commented May 6, 2021

Fixed by NatronGitHub/openfx-misc@824b1e9

I also changed a bit the colors to make them more visible on HiDPI/Retina displays:
image

@devernay devernay closed this as completed May 6, 2021
@blackearth2014
Copy link
Contributor

blackearth2014 commented May 6, 2021 via email

@blackearth2014
Copy link
Contributor

blackearth2014 commented May 6, 2021 via email

@devernay
Copy link
Member

devernay commented Jun 5, 2021

@blackearth2014 availaible on macOS Catalina & Big Sur https://github.com/NatronGitHub/Natron/releases/tag/v2.4.1-alpha2

@blackearth2014
Copy link
Contributor

@devernay,

I have downloaded the 2.4.1 version for Mac 64bit. The Alpha button is fixed but somehow the node graph delay came back a little bit. The 10.15 is 2.4.0 is working fine. So which one am I suppose to use?

@devernay
Copy link
Member

devernay commented Jun 8, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
func:plugins info:feedback-needed Further information is requested type:feature New feature or request ver:2.x
Projects
None yet
Development

No branches or pull requests

4 participants