Re: [Lcms-user] Question related to curve smoothing
An ICC-based CMM for color management
Brought to you by:
mm2
From: <mar...@li...> - 2025-05-09 08:02:02
|
Hello, > that email seems to have reached no-one. Too bad. I was not aware of any issues on the mailing list. Thanks for let me know. I will double-check to see if the problem comes from the list or was just my mail client. Regarding your question, a good test would be to chain two ICC profiles for real devices. Take LUT-based ones, which you can identify easily by looking at file size, big sizes mean they are using CLUT and are complex. Take a profile for a real camera and a profile for a real monitor and try the algorithm to model the color transform with those. If you try sRGB + AdobeRGB, you are just chaining two matrixes and you can't see the real power, although the algorithm works equally well. Here is a description on how to implement it: a) Use LittleCMS to create a color transform from source RGB to destination RGB. Use cmsFLAGS_NOOPTIMIZE to get maximum accuracy. With this you have a way to evaluate RGB->R'G'B' b) Compute the neutral curves. For example, on 256 values, for (i=0; i < 256; i++) R[i]=G[i]=B[i] = i; and then using a) obtain the R'G'B' of those 256 values. It is certainly possible that R' != G' != B' if you use real devices. c) Smooth a little bit those curves, make sure those are monotonic. You can use any algorithm you wish. The important thing is to get rid of abrupt changes and make them monotonic to allow the inverting. d) Invert the curves. LittleCMS gives you a function to do that. You can use any other algorithm you wish. c) Build the LUT for GPU by sampling all RGB cube. You want to obtain the R'G'B' for all RGB to model the color transformation in just one 3D table. You could do this directly and it would work more or less, but what the paper says is that if you use those inverted curves to linearize the RGB values first, the cube interpolation is much more efficient and you could get more accurate results with less nodes. Hope that makes sense to you All the best Marti Maria The LittleCMS Project https://www.littlecms.com > -----Original Message----- > From: Pekka Paalanen <pek...@ha...> > Sent: Thursday, May 8, 2025 12:07 PM > To: mar...@li... > Cc: lcm...@li... > Subject: Re: [Lcms-user] Question related to curve smoothing > > On Tue, 6 May 2025 19:18:55 +0200 > <mar...@li...> wrote: > > > Hello, > > I answered that mail on 24/3, see the answer attached. > > Hi Marti, > > as you can see in > https://sourceforge.net/p/lcms/mailman/lcms-user/thread/93d1cd5d-89f9- > 406e-965f-3ca3349aba1a%40riseup.net/#msg59164589 > that email seems to have reached no-one. > > Thanks for attaching it! > > I was hoping for more insight with the specific use case, because I am sure you > have extensive experience in applying the "ASIC prelinearization" algorithm. > Currently we do not know of a good test case nor what a typical situation > would even look like. > > Can you recommend a test case that would pose as many problems as > possible, but still be feasible to your taste for the prelinearization? > Some specific ICC profile combination, maybe? > > > shaper + 3D LUT is not supported by this function. > > What do you mean? Why is cmsSmoothToneCurve() not applicable to the > estimated shaper in > https://www.littlecms.com/ASICprelinerization_CGIV08.pdf ? > > > Thanks, > pq > > > -----Original Message----- > > From: Pekka Paalanen <pek...@ha...> > > Sent: Tuesday, May 6, 2025 9:40 AM > > To: lcm...@li... > > Subject: Re: [Lcms-user] Question related to curve smoothing > > > > On Mon, 24 Mar 2025 11:39:03 -0300 > > Leandro Ribeiro <lea...@ri...> wrote: > > > > > Hello, > > > > > > Based on [1], we've added the code to decompose a cmsHTRANSFORM > into > > > a shaper (3x1D LUT) + 3D LUT on Weston [2]. > > > > > > We want to smooth the shaper with cmsSmoothToneCurve(), but we don't > > > know exactly how to choose the lambda parameter. In [1] we have: > > > "lambda is a parameter by which we can trade smoothness of z against > > > fit to data y". But would there be any drawback in using lambda == > > > 0, i.e. allowing "full smoothness"? > > > > > > Any feedback from your experience with that would be appreciated. > > > > > > [1] https://www.littlecms.com/ASICprelinerization_CGIV08.pdf > > > [2] > > > https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1644 > > > |