BGR色彩空间究竟是什么? [英] What exactly is BGR color space?

查看:41
本文介绍了BGR色彩空间究竟是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

RGB 颜色由三个分量组成:红色 (0-255)、绿色 (0-255) 和蓝色 (0-255).

BGR 色彩空间究竟是什么?它与RGB色彩空间有何不同?

解决方案

RGB 代表 Red Green Blue.大多数情况下,RGB 颜色存储在结构体或无符号整数中,其中蓝色占据最低有效区域"(32 位和 24 位格式中的一个字节),绿色次之,红色第三次最少.

BGR 是相同的,只是区域的顺序颠倒了.红色占据最不重要的区域,绿色第二(静止),蓝色第三.

在某些平台(例如 Gamegear)上,使用 BGR 模型.但是,通常可能会使用 RGB(尽管许多图形 API 支持 BGR 以实现兼容性).我不确定为什么使用它;可能是历史性的.

示例:#FF0000 在读取为 RGB 十六进制颜色 (#rrggbb) 时为纯红色,因为第三个区域(从右到左读取数字!)是 FF(最大值,全色),其他两个区域是00(最小值,无颜色).如果 #FF0000 被读取为 BGR 十六进制颜色,它将是纯蓝色.

An RGB color is composed of three components: Red (0-255), Green (0-255) and Blue (0-255).

What exactly is BGR color space? How is it different from RGB color space?

解决方案

RGB stands for Red Green Blue. Most often, an RGB color is stored in a structure or unsigned integer with Blue occupying the least significant "area" (a byte in 32-bit and 24-bit formats), Green the second least, and Red the third least.

BGR is the same, except the order of areas is reversed. Red occupies the least significant area, Green the second (still), and Blue the third.

On some platforms (e.g. the Gamegear), a BGR model is used. However, often, RGB might be used (though BGR is supported by many graphics API's for compatibility). I'm not sure why exactly it's used; probably historical.

Example: #FF0000 is pure red when reading as an RGB hex color (#rrggbb), because the third area (numbers are read right to left!) is FF (maximum value, full color) and the other two areas are 00 (minimum value, no color). If #FF0000 were read as a BGR hex color, it'd be pure blue.

这篇关于BGR色彩空间究竟是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆