Boost logo

Boost :

From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2020-04-01 19:19:09


Hi,

The conversion we've got is not colorimetric or profile-based
(discussed for GIL in [1]) but it is an approximation (based on
variant 2 from book [2]) which, of course, gives imprecise results [3].

Question is, how imprecise they can be especially for cases
like high depth color components e.g. gil::cmyk32_pixel_t
which is a known bug https://github.com/boostorg/gil/issues/406
or convoluted cases of signed (negative values) for color
components e.g. rgb8s_pixel_t to cmyk8_pixel_t

Any CMYK gurus or fans out there?
Here is an example of RGB colors convertible to CMYK:

// 8-bit signed white color
gil::rgb8s_pixel_t p2{(char)128, (char)128, (char)128};
gil::cmyk8s_pixel_t c2;
gil::color_convert(p2, c2); // c2 = {?, ?, ?, ?}

// 8-bit signed black color
gil::rgb8s_pixel_t p3{(char)-127, (char)-127, (char)-127};
gil::cmyk8s_pixel_t c3;
gil::color_convert(p3, c3); // c3 = {?, ?, ?, ?}

Spoiler: both give the same CMYK color :)

[1] https://github.com/boostorg/gil/wiki/Boost.GIL-3-Ideas#extension-color-management
[2] Principles of Digital Image Processing - Fundamental Techniques by
Burger, Wilhelm, Burge, Mark J.
[3] https://stackoverflow.com/a/4858175/151641

Best regards,

-- 
Mateusz Loskot, http://mateusz.loskot.net

Boost list run by Boost-Gil-Owners