Create a custom RGB printer profile from measured data.

2 次查看(过去 30 天)
I would like to use MATLAB to build a custom rgb2xyz AToB0 ICC profile for an RGB printer. I have a Nx3 array of RGB values and an Nx3 array of XYZ values measured from a target. Is there way I can use available MATLAB tools to build the ICC profile, either from scratch, or from the framework of another RGB printer profile? It seems the makecform function only works with existing profiles or default datasets. Thanks!

回答(1 个)

Anshuman
Anshuman 2023-8-8
Hi Brian,
In MATLAB, you can use the Color Matching Functions (CMFs) and the makecform function to build a custom ICC profile for an RGB printer. However, it's important to note that creating a complete ICC profile requires a deep understanding of color management principles and the ICC specification.
To build a custom ICC profile using your own RGB-to-XYZ data, you can follow these steps:
  1. Prepare your RGB and XYZ measurement data in Nx3 arrays.
  2. Normalize the RGB and XYZ values to the range [0, 1].
  3. Define the color space transformation using the RGB and XYZ data. This involves creating a custom color transformation structure.
  4. Use the 'makecform' function to create a custom color transform function based on the defined color transformation structure.
  5. Apply the custom color transform function to your RGB data to obtain the corresponding XYZ values.
  6. Use the generated XYZ data to build the ICC profile.
Here is an example code:
% Step 1: Prepare RGB and XYZ data
RGB = ... % Nx3 array of RGB values
XYZ = ... % Nx3 array of corresponding XYZ values
% Step 2: Normalize the RGB and XYZ values
RGB = RGB / 255; % Normalize RGB values to [0, 1]
XYZ = XYZ / max(XYZ(:)); % Normalize XYZ values to [0, 1]
% Step 3: Define the color transformation structure
colorTransform = makecform('custom', 'Type', 'xyz', 'ColorSpace', 'linear', 'WhitePoint', 'd65', 'AdaptedWhitePoint', XYZ(1,:));
% Step 4: Create custom color transform function
customTransform = @(x) applycform(x, colorTransform);
% Step 5: Apply custom color transform to RGB data
transformedXYZ = customTransform(RGB);
% Step 6: Build ICC profile using transformed XYZ data
Hope it helps!
  1 个评论
Brian Gamm
Brian Gamm 2023-10-24
@Anshuman, I'm trying to use this workflow but I'm getting an error in Step 3, "The input, 'custom', did not match any of the valid values" since there is no "custom" color space conversion type. Can you provide additional guidance on creating a custom cform structure?

请先登录,再进行评论。

产品


版本

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by