adobeRGB 转换为sRGB 怎么转换?

hope_v 2014-08-11 02:07:35
有一堆的rc2格式的照相机原始数据图片。查了不少资料说存的是adobeRGB格式的,现在需要把这东西转换为sRGB,需要怎么做呢?公式是怎么样呢?
adobeRGB 是 48bit,16bit * 3
sRGB 是 24bit,8bit * 3

谢谢了,实在找不到公式了。
...全文
2337 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
hope_v 2014-08-11
  • 打赏
  • 举报
回复
原来对raw图像的支持不需要自己去弄,用FreeImage库就好了, 结贴了
Hope_f 2014-08-11
  • 打赏
  • 举报
回复
解决了,结果用FreeImage库,载入时选择FIF_RAW的flags = RAW_PREVIEW。 没理会具体他是怎么实现转换,反正这样载入后的raw图像就是亮度正常了。若图像被旋转了,则使用FreeImage_FlipHorizontal进行水平镜像。
hope_v 2014-08-11
  • 打赏
  • 举报
回复
还有个比较全的博客:http://blog.csdn.net/jtop0/article/details/7217247
hope_v 2014-08-11
  • 打赏
  • 举报
回复
http://en.wikipedia.org/wiki/RGB_color_space 还有这个地址,rgb的说明,里面有将sRGB和adobeRGB 求解~~~
hope_v 2014-08-11
  • 打赏
  • 举报
回复
http://stackoverflow.com/questions/11041044/python-pil-convert-jpg-from-adobergb-to-srgb 对了,网站在这里,python convert jpg from adobeRGB to sRGB http://tieba.baidu.com/p/2690719835 http://zh.wikipedia.org/wiki/SRGB http://zh.wikipedia.org/wiki/Adobe_RGB_%E8%89%B2%E5%BD%A9%E7%A9%BA%E9%97%B4 http://tieba.baidu.com/p/1038139059 http://zhidao.baidu.com/link?url=BXl9xSH9fhN0smT8-_HCyvYDSS9lOIcpBnx7CAQ0dYfqayj4Q34hn8BPqcM-YQLtnjXbxATE6H3LYkULG3YqA_ 这是raw图像格式相关的说明
  • 打赏
  • 举报
回复
引用 7 楼 hope_v 的回复:
[quote=引用 6 楼 u013400368 的回复:] 看看这个贴,之前我说的没有用。。。
非常谢谢你。 adobeRGB 转换为sRGB ,是颜色空间之间的关系,跟16bit和8bit,跟565和555不一样的。 adobeRGB相比sRGB还记录有好多信息,adobeRGB是设备产生的直接像素信息(设备单元记录下来的传感器数据),属于元数据,没有修改过的。 Adobe RGB还包含了sRGB所没有完全覆盖的CMYK色彩空间。这使得Adobe RG8色彩空间在印刷等领域具有更明显的优势。 这是找到的一段python中PIL的代码,可是没搞懂,image.convert中使用的那个矩阵是怎么起作用的,并且我作为矩阵相乘来测试,结果还是很暗。 adobe_to_xyz和xyz_to_srgb Thanks for the spec link martineau, I've put some working PIL code together with functions that detect the presence of a Adobe RGB ICC profile within an Image, and convert the colorspace to sRGB. adobe_to_xyz = ( 0.57667, 0.18556, 0.18823, 0, 0.29734, 0.62736, 0.07529, 0, 0.02703, 0.07069, 0.99134, 0, ) # http://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf xyz_to_srgb = ( 3.2406, -1.5372, -0.4986, 0, -0.9689, 1.8758, 0.0415, 0, 0.0557, -0.2040, 1.0570, 0, ) # http://en.wikipedia.org/wiki/SRGB def adobe_to_srgb(image): return image.convert('RGB', adobe_to_xyz).convert('RGB', xyz_to_srgb) def is_adobe_rgb(image): return 'Adobe RGB' in image.info.get('icc_profile', '') # alternative solution if happy to retain profile dependency: # http://stackoverflow.com/a/14537273/284164 # icc_profile = image.info.get("icc_profile") # image.save(destination, "JPEG", icc_profile=icc_profile) (I used these to create a Django easy-thumbnails processor function): def preserve_adobe_rgb(image, **kwargs): if is_adobe_rgb(image): return adobe_to_srgb(image) return image [/quote] 学到了。
bigbirdwind 2014-08-11
  • 打赏
  • 举报
回复
这个真不懂。。只能帮顶。。
hope_v 2014-08-11
  • 打赏
  • 举报
回复
引用 6 楼 u013400368 的回复:
看看这个贴,之前我说的没有用。。。
非常谢谢你。 adobeRGB 转换为sRGB ,是颜色空间之间的关系,跟16bit和8bit,跟565和555不一样的。 adobeRGB相比sRGB还记录有好多信息,adobeRGB是设备产生的直接像素信息(设备单元记录下来的传感器数据),属于元数据,没有修改过的。 Adobe RGB还包含了sRGB所没有完全覆盖的CMYK色彩空间。这使得Adobe RG8色彩空间在印刷等领域具有更明显的优势。 这是找到的一段python中PIL的代码,可是没搞懂,image.convert中使用的那个矩阵是怎么起作用的,并且我作为矩阵相乘来测试,结果还是很暗。 adobe_to_xyz和xyz_to_srgb Thanks for the spec link martineau, I've put some working PIL code together with functions that detect the presence of a Adobe RGB ICC profile within an Image, and convert the colorspace to sRGB. adobe_to_xyz = ( 0.57667, 0.18556, 0.18823, 0, 0.29734, 0.62736, 0.07529, 0, 0.02703, 0.07069, 0.99134, 0, ) # http://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf xyz_to_srgb = ( 3.2406, -1.5372, -0.4986, 0, -0.9689, 1.8758, 0.0415, 0, 0.0557, -0.2040, 1.0570, 0, ) # http://en.wikipedia.org/wiki/SRGB def adobe_to_srgb(image): return image.convert('RGB', adobe_to_xyz).convert('RGB', xyz_to_srgb) def is_adobe_rgb(image): return 'Adobe RGB' in image.info.get('icc_profile', '') # alternative solution if happy to retain profile dependency: # http://stackoverflow.com/a/14537273/284164 # icc_profile = image.info.get("icc_profile") # image.save(destination, "JPEG", icc_profile=icc_profile) (I used these to create a Django easy-thumbnails processor function): def preserve_adobe_rgb(image, **kwargs): if is_adobe_rgb(image): return adobe_to_srgb(image) return image
bigbirdwind 2014-08-11
  • 打赏
  • 举报
回复
引用 5 楼 hope_v 的回复:
[quote=引用 2 楼 zjq9931 的回复:] [quote=引用 楼主 hope_v 的回复:] 有一堆的rc2格式的照相机原始数据图片。查了不少资料说存的是adobeRGB格式的,现在需要把这东西转换为sRGB,需要怎么做呢?公式是怎么样呢? adobeRGB 是 48bit,16bit * 3 sRGB 是 24bit,8bit * 3 谢谢了,实在找不到公式了。
试试用比例,即16bit的R、G、B,除以16bit的最大数(65535),得数(小于1的小数)。再乘以8bit的最大数(255)。应当是可以。 声音都是这么转换的。[/quote] 这就是区别[/quote]http://bbs.csdn.net/topics/80406950 看看这个贴,之前我说的没有用。。。
hope_v 2014-08-11
  • 打赏
  • 举报
回复
引用 2 楼 zjq9931 的回复:
[quote=引用 楼主 hope_v 的回复:]
有一堆的rc2格式的照相机原始数据图片。查了不少资料说存的是adobeRGB格式的,现在需要把这东西转换为sRGB,需要怎么做呢?公式是怎么样呢?
adobeRGB 是 48bit,16bit * 3
sRGB 是 24bit,8bit * 3

谢谢了,实在找不到公式了。

试试用比例,即16bit的R、G、B,除以16bit的最大数(65535),得数(小于1的小数)。再乘以8bit的最大数(255)。应当是可以。
声音都是这么转换的。[/quote]

这就是区别
hope_v 2014-08-11
  • 打赏
  • 举报
回复
引用 2 楼 zjq9931 的回复:
[quote=引用 楼主 hope_v 的回复:] 有一堆的rc2格式的照相机原始数据图片。查了不少资料说存的是adobeRGB格式的,现在需要把这东西转换为sRGB,需要怎么做呢?公式是怎么样呢? adobeRGB 是 48bit,16bit * 3 sRGB 是 24bit,8bit * 3 谢谢了,实在找不到公式了。
试试用比例,即16bit的R、G、B,除以16bit的最大数(65535),得数(小于1的小数)。再乘以8bit的最大数(255)。应当是可以。 声音都是这么转换的。[/quote] 嗯,我就是这么做的,但是这两种都不是一个空间的,这么做的结果是,相比其他软件打开后的效果图像亮度很暗。
hope_v 2014-08-11
  • 打赏
  • 举报
回复
引用 1 楼 u013400368 的回复:
中间用浮点数转换怎么样
什么意思? adobeRGB 和 sRGB不是一个空间的,我是直接将16bit弄成8bit显示,发现颜色很暗,而其他软件打开后颜色不是按的(有做空间转换)。
  • 打赏
  • 举报
回复
引用 楼主 hope_v 的回复:
有一堆的rc2格式的照相机原始数据图片。查了不少资料说存的是adobeRGB格式的,现在需要把这东西转换为sRGB,需要怎么做呢?公式是怎么样呢? adobeRGB 是 48bit,16bit * 3 sRGB 是 24bit,8bit * 3 谢谢了,实在找不到公式了。
试试用比例,即16bit的R、G、B,除以16bit的最大数(65535),得数(小于1的小数)。再乘以8bit的最大数(255)。应当是可以。 声音都是这么转换的。
bigbirdwind 2014-08-11
  • 打赏
  • 举报
回复
中间用浮点数转换怎么样

64,648

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧