如何高效地将 sRGB 转换为 CIELAb 以及 CIELab 转换为 sRGB?

发布于 2024-09-27 06:51:09 字数 1436 浏览 14 评论 0 原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

羁客 2024-10-04 06:51:09

通过应用反伽马从 sRGB 转换为 RGB,使用 3x3 矩阵将 RGB 转换为 XYZ,使用标准公式和 D6500 白点将 XYZ 转换为 Lab

参考:

其余的......你可以自己做:-)

Convert from sRGB to RGB by applying inverse gamma, convert RGB to XYZ using 3x3 matrix, convert XYZ to Lab using standard formula and D6500 white point

References:

The rest... you can do on your own :-)

倾城花音 2024-10-04 06:51:09

为了以防万一,我准备了一个链接列表(使用不同的编程语言),这对于转换过程(sRGB 到 LAB 和返回)以及 sRGB 到线性 RGB 的转换很有帮助。线性 RGB 还可用于图像的白平衡和颜色校准(提供色标,如 Macbeth 色卡)。

有趣的链接:

(i)了解 sRGB 和线性 RGB 空间:http://filmicgames.com/archives/299; http://www.cambridgeincolour.com/tutorials/gamma- Correction.htm

(ii) MATLAB 教程:https://de.mathworks.com/help /vision/ref/colorspaceconversion.html

(iii) Python 包: http://pydoc.net/Python/pwkit/0.2.1/pwkit.colormaps/

(iv) C 代码:http://svn.int64.org/viewvc/int64/colors/color.c?view=markup

(v) OpenCV 不提供 sRGB 到线性 RGB 转换,但它在 color.cpp 代码内进行转换(OpenCV_DIR\modules\imgproc\src\color.cpp)。查看名为initLabTabs()的方法,有一个gamma编码和解码。 OpenCV 颜色转换 API: http://docs.opencv.org/3.1 .0/de/d25/imgproc_color_conversions.html

In case, I have prepared a list of links (in different programming languages) which can be helpful for the conversion process (sRGB to LAB and back) and also, conversion of sRGB to linear RGB. Linear RGB can be further used for white balance and color calibration of an image (provided color patch, like Macbeth color chart).

Interesting links:

(i) Understanding sRGB and linear RGB space: http://filmicgames.com/archives/299; http://www.cambridgeincolour.com/tutorials/gamma-correction.htm

(ii) MATLAB tutorial: https://de.mathworks.com/help/vision/ref/colorspaceconversion.html

(iii) Python package: http://pydoc.net/Python/pwkit/0.2.1/pwkit.colormaps/

(iv) C code: http://svn.int64.org/viewvc/int64/colors/color.c?view=markup

(v) OpenCV does not provide sRGB to linear RGB conversion but it does the conversion inside color.cpp code (OpenCV_DIR\modules\imgproc\src\color.cpp). Check out method called initLabTabs(), there is a gamma encoding and decoding. OpenCV color conversion API: http://docs.opencv.org/3.1.0/de/d25/imgproc_color_conversions.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文