libopenshot icon indicating copy to clipboard operation
libopenshot copied to clipboard

Effect "Color Map" does not support 1D LUTs, only 3D LUTs.

Open stolk opened this issue 1 month ago • 5 comments

Description:

The Color Map effect is hard-coded to look for LUT_3D_SIZE in the .cube file. If the file contains a 1D LUT instead using LUT_1D_SIZE then the color mapping does not work.

For a specification of .cube file format, see: https://kono.phpage.fr/images/a/a1/Adobe-cube-lut-specification-1.0.pdf

Reproduction Steps:

  1. Download latest RC candidate binary.
  2. Launch app image file.
  3. Add a video clip and drag it to timeline.
  4. Open Effects tab.
  5. Drag "Color Map / Lookup" onto the clip.
  6. Set the cube filename to a file that contains a 3D LUT.
  7. Observe: color mapping works.
  8. Change the cube filename to a file that contains a 1D LUT.
  9. Observe: color mapping does not work.

Expected Behaviour:

Color mapped video, regardless whether a 1D or a 3D map is being used.

Version: 3.4.0 Release Candidate

OS: Ubuntu 25.04

stolk avatar Nov 16 '25 21:11 stolk

The code in question that hard-codes the 3D LUT support, is here:

https://github.com/OpenShot/libopenshot/blob/develop/src/effects/ColorMap.cpp#L45

if (line.startsWith("LUT_3D_SIZE")) {

And no checks for LUT_1D_SIZE are made.

NOTE: I can attempt to add support for this, and contribute back.

UPDATE: I created a PULL-REQUEST that fixes this.

stolk avatar Nov 16 '25 21:11 stolk

NOTE: The Color Map reader also ignores the DOMAIN_MIN and DOMAIN_MAX values in the .cube file.

stolk avatar Nov 16 '25 22:11 stolk

Thanks for the bug report! Appreciate it. I'm working on support for both 1D and 3D LUT files. I've got it mostly working now - but adding a few more unit tests to validate it.

jonoomph avatar Nov 18 '25 23:11 jonoomph

Thanks for the bug report! Appreciate it. I'm working on support for both 1D and 3D LUT files. I've got it mostly working now - but adding a few more unit tests to validate it.

Did you see the pull-request I made?

stolk avatar Nov 19 '25 01:11 stolk