From: <mar...@li...> - 2020-05-18 12:52:15
|
Hi, It seems to me that this code is reading the lab pixelss from the file format, doing some math on floating point with those values and then filling a cmsCIELab structure, which is also floating point. Then it performs a color transform to convert to RGB 8. You can do that in this way but is extremly inefficient. Rather, I would investigate how the file format stores Lab in 8 and 16 bits and convert it to Lab16 V4 ICC format, which is documented in ICC spec and Lcms manual. You don´t need floats at all to do this. Then doing the color transform from Lab16 The throughput gain can be times x4 or more. Hope that helps Marti Quoting Aaron Boxer <bo...@gm...>: > Hello! > This isn't strictly an lcms question, but I was wondering if anyone here > can give me some insight into a few lines of code I've inherited in my > project that use > lcms to convert Lab to RGB: > > https://github.com/GrokImageCompression/grok/blob/master/src/bin/common/color.cpp#L742 > > This code works for 8 bit Lab but not for 16 bit and I am trying to fix > this. I am particularly wondering about the three constants 100, 170 and > 200. > > Any insight would be greatly appreciated. > Thanks! > Aaron |