RGB2IND
Convert RGB image to indexed image
Syntax
Description
Examples
Input Arguments
Output Arguments
算法
Uniform Quantization — If you specify
tol
, thenRGB2IND
使用统一量化来转换图像。均匀量化将RGB颜色立方体切成长度的较小立方体tol
. For example, if you specify atol
of 0.1, then the edges of the cubes are one-tenth the length of the RGB cube. The total number of small cubes is:t = (floor(1/tol)+1)^3
Each cube represents a single color in the output image. Therefore,
t
is the maximum length of the colormap .RGB2IND
removes any colors that don’t appear in the input image, so the actual colormap can be smaller thant
.最小差异量化 - 如果指定
Q
, thenRGB2IND
使用最小方差量化。最小方差量化将RGB颜色立方体切成不同尺寸的较小盒子(不一定是立方体),这取决于图像中的颜色分布方式。如果输入图像实际上使用的颜色少于指定的数字,则输出colormap也小。Inverse Colormap — If you specify an input colormap
iNMAP
, thenRGB2IND
uses colormap mapping. The inverse colormap algorithm quantizes the specified colormap into 32 distinct levels per color component. Then, for each pixel in the input image, the closest color in the quantized colormap is found.
参考
[1] Spencer W. Thomas,“有效的逆色图计算”,图形Gems II, (ed. James Arvo), Academic Press: Boston. 1991. (includes source code)