如何找到图像中有多少种颜色? [英] How can I find how many colours are there in an image?

查看:154
本文介绍了如何找到图像中有多少种颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b

我正在寻找一种方法来查找图像中的颜色数量?它们是哪种颜色?

Hi
I am looking for a way to find number of colours are there in an image ? and they are which colours ?

推荐答案

你有一个模糊的问题,但我会试一试。



提示:

您需要知道图像使用的文件格式的结构。

从这里,您将知道保存颜色数据的位置。

然后您可以解析文件并计算保存的唯一颜色数据。



这是否回答了您的问题?
You have a vague question but i''ll give it a go.

Tip:
You need to know the structure of the file format used by the image.
From here, you will know where the colour data is saved.
You can then just parse through the file and count the unique colour data saved.

Does this answer your question?


GetDIBits()

http://msdn.microsoft.com/en-us/library/windows/desktop/dd144879(v = vs.85).aspx [ ^ ]

$ / b $ b或



GetPixel()



http://msdn.microso ft.com/ru-ru/library/system.drawing.bitmap.getpixel.aspx [ ^ ]
GetDIBits()
http://msdn.microsoft.com/en-us/library/windows/desktop/dd144879(v=vs.85).aspx[^]

or

GetPixel()

http://msdn.microsoft.com/ru-ru/library/system.drawing.bitmap.getpixel.aspx[^]


这篇关于如何找到图像中有多少种颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆