【发布时间】:2012-07-17 20:53:17
【问题描述】:
我可以使用BufferedImage 获取 640x640 图像的每个像素的 RGB 值,输出如下所示:
[...]
Pixel :(640, 634) RGB: 166 94 82
Pixel :(640, 635) RGB: 166 94 80
Pixel :(640, 636) RGB: 163 91 77
Pixel :(640, 637) RGB: 157 88 73
Pixel :(640, 638) RGB: 157 88 73
Pixel :(640, 639) RGB: 159 90 74
Pixel :(640, 640) RGB: 158 89 73
This image has 69197 colors.
我需要将这种方式获得的每种 RGB 颜色分类为 3 位 RGB(8 种颜色),我需要知道如何做到这一点...如何知道每种颜色的 RGB 范围3 位 RGB 的 8 种颜色。谢谢!
【问题讨论】:
-
这个操作叫做dithering。
标签: java rgb bufferedimage color-palette