您的位置:首页 > 其它

RGB_565,ALPHA_8,ARGB_4444,ARGB_8888

2017-10-21 15:00 513 查看
我们项目中使用bitmap的时候可能会遇到这些参数,具体这些参数是用来做什么的呢?

A bitmap configuration describes how pixels are stored.


答案是:这四个参数是用来描述bitmap被存储时的像素值。

还是不懂?简单解释下!

RGB色彩模式是工业界的一种颜色标准,是通过对红(R)、绿(G)、蓝(B)三个颜色通道的变化以及它们相互之间的叠加来得到各式各样的颜色的,RGB即是代表红、绿、蓝三个通道的颜色,这个标准几乎包括了人类视力所能感知的所有颜色,是目前运用最广的颜色系统之

我们知道RGB可以用来组合所有的颜色,除此之外A透明度也可以间接表示,这四个要素分别对应一个通道,系统保存图像每个像素使用通道保存

这样我们就能理解了:

RGB_565 表示red green blue只用三个通道保存图像

ALPHA_8 表示alpha只用此通道保存图像

ARGB_4444 表示alpha red green blue用全通道保存图像

ARGB_8888 表示alpha red green blue用全通道保存图像

明白了前面字母的含义,但是数字如何理解呢?

ALPHA_8

Each pixel is stored as a single translucency (alpha) channel.

This is very useful to efficiently store masks for instance.

No color information is stored. (不保存颜色信息)

With this configuration, each pixel requires 1 byte of memory.(占用1个字节的内存,1 byte=8 bits也就是8位,所以用8表示)


RGB_565

Each pixel is stored on 2 bytes and only the RGB channels are
encoded: red is stored with 5 bits of precision (32 possible
values), green is stored with 6 bits of precision (64 possible
values) and blue is stored with 5 bits of precision.

红色占用5位,绿色占用6位,蓝色占用5位,一共使用了16位,也就是16 bits=2byte


ARGB_4444

Each pixel is stored on 2 bytes

同理可得,每个通道占用4位,一共是2 bytes


ARGB_8888

Each pixel is stored on 4 bytes

同理可得,每个通道占用8位,一共是4 bytes
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  rgb bitmap ARGB-8888