简体   繁体   English

如何减少图像的 colors,使其具有确切数量的 colors?

[英]How can I reduce colors of an image so it would have an exact number of colors?

I have an image with a histogram that look like this:我有一个带有直方图的图像,如下所示: 在此处输入图像描述

I want the image to have only 10 different colors, how can I do that?我希望图像只有 10 个不同的 colors,我该怎么做? (in other words I want the histogram to only have 10 values). (换句话说,我希望直方图只有 10 个值)。

Use a lookup table that associates [0,11] to 0, [12,35] to 23, [26,58] to 46... and [219, 255] to 230.使用将 [0,11] 与 0、[12,35] 与 23、[26,58] 与 46... 以及 [219, 255] 与 230 相关联的查找表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM