BGR颜色空间到底是什么? [英] What exactly is BGR color space?

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

问题描述

RGB颜色由三部分组成:红色(0-255),绿色(0-255)和蓝色(0-255).

BGR颜色空间到底是什么?与RGB颜色空间有何不同?

解决方案

RGB代表红色绿色蓝色.最常见的是,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天全站免登陆