[Lcms-user] Creating equivalent matrix-shaper and 3D LUT profiles, problem with BPC
An ICC-based CMM for color management
Brought to you by:
mm2
From: Pekka P. <pek...@ha...> - 2024-03-15 11:21:40
|
Hi, I'm working on a Wayland compositor (Weston) to integrate LittleCMS in it. I use LittleCMS to come up with the color transformation from ICC profiles, then extract and optimize the cmsPipeline, and implement it in OpenGL ES 3.0 shaders. I have some difficulty in generating ICC profiles in Weston's test suite. I want the test suite to exercise all code paths to ensure the color operations are implemented correctly. I have separate code paths for matrices+curves and 3D LUTs. Which code path gets chosen depends on what processing blocks (cmsStage) an ICC file results in. Therefore, I would like to craft identically behaving ICC files that hit the different code paths (the goal). Crafting matrix-shaper profiles is easy. Crafting an equivalent profile that internally has a 3D LUT (DToB/BToD) is the problem. I can craft such an ICC profile, but because I need to test with the perceptual rendering intent, I should also include BPC between the zeros black point of a matrix-shaper and the non-zero black point of the v4 perceptual PCS. Otherwise the assumption that a perceptual v4 CLUT profile has the ICCv4 defined perceptual black point does not hold, and the tests fail. Is my goal reasonable to begin with, or should I just accept that exercising the different Weston GL ES code paths by means of different ICC profiles cannot lead to identical results and I need to define my expected test results separately for each case? If my goal is reasonable, then what would be a good way to add the required BPC? Can I make LittleCMS compute it for me, or should I just copy the BPC algorithm from LittleCMS? I've tried creating the DToB/BToD test profile 3D LUT by creating a chain of the usual matrix-shaper profile and the abstract XYZ profile and sampling that, but now I'm convinced that I cannot get BPC applied that way, not with the XYZ profile at least. Thanks, pq |