View Issue Details

IDProjectCategoryView StatusLast Update
0000238Cinelerra-GG[All Projects] Featurepublic2019-06-05 19:53
ReporterOlafAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000238: Compositor: ICC profile support
DescriptionSupport of ICC (display) profiles for the Compositor/Viewer. Cinelerra-GG recently started advertising with "8K Support" and "10-bit Color Space". Such promises have to be kept.

Compositor/Viewer are stuck without profiles in the color space sRGB of X11, which can amount to that: What you see is not what you get. Color grading becomes a shot in the dark, false colors after export (colorspace BT.709, BT.2020) can be the result. A color correction can only work correctly in a controlled color space. The BT.2020 color space is of no use to you because you are forced to set the monitor down to sRGB to see what you are doing. Exporting to a larger color space then makes the colors visible that were not visible during editing.

The media player mpv can integrate such profiles, maybe it serves as a source.
TagsColor Space, Compositor, ICC profile

Activities

Andrew-R

Andrew-R

2019-06-05 19:53

reporter   ~0001663

yeah, OpenColorIO seems to be more complete (capable?) solution. In c++. With GPU path (hopefully GLSL, and not just Cg from NVIDIA proprietary past) , too.
http://opencolorio.org/developers/usage_examples.html

But probably complete support will require also saving this 'color profile' info into image formats, and reading it back? Still, display seems to be first logical (most visibly) step.
PhyllisSmith

PhyllisSmith

2019-06-05 15:11

manager   ~0001660

I will close 64 since this refers to it and since I can still look at it for future information when/if we ever get to this ticket. Other than bugs and looking into CUDA, issue 0000002 of MASKING and all of its side issues is the oldest so takes the highest precedence.
Andrea_Paz

Andrea_Paz

2019-06-05 14:14

updater   ~0001659

A subject I'm very interested in.
On the color management there is also an old ticket (0000064); maybe you can close it and leave only this.
Andrew-R

Andrew-R

2019-06-05 11:09

reporter   ~0001657

and discussion on CPU-only threaded use:

https://sourceforge.net/p/lcms/mailman/message/30848823/
(relative to lcms2-2.4)
--------copy------
 Hughes wrote:
> Hi all,
>
> I'm trying to make my transform go fast. I've got a 1920x1080 RGB
> image being transformed from sRGB to the display profile. I've got a
> quad core processor on my development box, no shaders or GPU, and I'm
> trying to do the transform as quickly as possible.

Re: [Lcms-user] Threading performance in LCMS2
From: Sebastien Leon <sleon@po...> - 2013-05-30 20:32:04
  
  Hi Richard,

[....]

- littleCMS legacy code : 92.12 CPU Cycle per pixel transformed
- littleCMS hacked : 27.75 CPU Cycle per pixel transformed
--------copy end-----

so, for 2Mpx image (~fullHD) it will be ... 93 * 1920 * 1080 = 194,273,280 cycles. *30 fps = 5,828,198,400 = 6Ghz core ... Note at the same thread it was said "Note that I also rewrote the critic loop with SSE4 assembly code (just for fun). I found no real improvement because most of the work is about
memory exchange... So I kept the basic C code..." . Other links also alive (about measuring time spend in those transforms).

Not sure if those transforms will work directly on yuv data ... so, probably initial implementation can only work with some project colorspaces (RGBA8/float?) and some video outputs (GL/X11) ?
Andrew-R

Andrew-R

2019-06-04 18:36

reporter   ~0001653

Not sure if this will be of any use, but there was little discussion about OpenGL and iccpprofiles:

https://sourceforge.net/p/lcms/mailman/message/33575634/

-----------------copy--------------------
Re: [Lcms-user] Adobe's Color Engine, GPUs, And Other Rambling
From: Gerhard Fuernkranz <nospam456@gm...> - 2015-03-10 19:25:03
 Attachments: Message as HTML
  Create an RGB -> RGB transform and re-sample it on a regular grid,
for instance like below (code is a bit older, still using lcms1, though).

Regards,
Gerhard


#define GRIDPOINTS 64

static GLushort clut[GRIDPOINTS][GRIDPOINTS][GRIDPOINTS][3];

static GLuint img_texture;
static GLuint clut_texture;
static GLfloat clut_scale;
static GLfloat clut_offset;

void
make_clut_texture(const char *profile_name)
{
     int r, g, b, n = GRIDPOINTS;
     cmsHPROFILE sRGB, monitor;
     cmsHTRANSFORM xform;

     sRGB = cmsCreate_sRGBProfile (); // image profile
     monitor = cmsOpenProfileFromFile (profile_name, "r");

     if (monitor == NULL) {
         fprintf(stderr, "Cannot open display profile %s\n", profile_name);
         exit(1);
     }

     xform = cmsCreateTransform (sRGB, TYPE_RGB_16, monitor, TYPE_RGB_16,
                                 INTENT_PERCEPTUAL, cmsFLAGS_NOTPRECALC);

     if (xform == NULL) {
         fprintf(stderr, "Failed to create transformation\n");
         exit(1);
     }

     clut_scale = (double) (n - 1) / n;
     clut_offset = 1.0 / (2 * n);

     for (r = 0; r < n; r++) {
         for (g = 0; g < n; g++) {
             for (b = 0; b < n; b++) {
                 unsigned short in[3];
                 in[0] = floor ((double) r / (n - 1) * 65535.0 + 0.5);
                 in[1] = floor ((double) g / (n - 1) * 65535.0 + 0.5);
                 in[2] = floor ((double) b / (n - 1) * 65535.0 + 0.5);
                 cmsDoTransform (xform, in, clut[b][g][r], 1);
             }
         }
     }

     cmsDeleteTransform (xform);
     cmsCloseProfile (monitor);
     cmsCloseProfile (sRGB);

     glGenTextures (1, &clut_texture);
     /* texture 1 = clut */
     glActiveTextureARB (GL_TEXTURE0_ARB + 1);
     glBindTexture (GL_TEXTURE_3D, clut_texture);

     glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP);
     glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP);
     glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP);
     glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

     glTexImage3D (GL_TEXTURE_3D, 0, GL_RGB16, n, n, n,
                   0, GL_RGB, GL_UNSIGNED_SHORT, clut);

     /* back to texture 0 = image */
     glActiveTextureARB (GL_TEXTURE0_ARB);
}
-------------------copy end------

additionally there was this comment at the end:

----copy------------
Re: [Lcms-user] Adobe's Color Engine, GPUs, And Other Rambling
From: Gerhard Fuernkranz <nospam456@gm...> - 2015-03-10 23:54:12
  
  Am 11.03.2015 um 00:36 schrieb marti.maria@...:
>
> Quoting Gerhard Fuernkranz <nospam456@...>:
>
>> Create an RGB -> RGB transform and re-sample it on a regular grid,
>> for instance like below (code is a bit older, still using lcms1, though).
>
> Great idea. lcms2 works fine in this way. Please note in lcms2 you can get float, double or "half float" values directly, so you need not to downscale to 16 bits anymore. For instance, in half float type, use TYPE_RGB_HALF_FLT as formatter.

The reason for the integer LUT texture was actually the inability of my GPU to interpolate 3D float textures with GL_LINEAR filter, when I wrote this stuff quite some years ago. Likely, recent GPUs don't suffer from such a limitation any more.

Regards,
Gerhard
--------------------copy end-------------------

so, this might help with X11-OpenGL. For plain X11 - just same thing via CPU? (GIMP 2.10.x probably uses software/CPU method)
Olaf

Olaf

2019-06-04 11:40

reporter  

Issue History

Date Modified Username Field Change
2019-06-04 11:40 Olaf New Issue
2019-06-04 11:40 Olaf File Added: Compsotor-mpv_with_display_profile.jpg
2019-06-04 11:48 Olaf Tag Attached: Compositor
2019-06-04 11:48 Olaf Tag Attached: Color Space
2019-06-04 11:48 Olaf Tag Attached: ICC profile
2019-06-04 18:36 Andrew-R Note Added: 0001653
2019-06-05 11:09 Andrew-R Note Added: 0001657
2019-06-05 14:14 Andrea_Paz Note Added: 0001659
2019-06-05 15:11 PhyllisSmith Note Added: 0001660
2019-06-05 19:53 Andrew-R Note Added: 0001663