在.NET彩色图像量化 [英] Color Image Quantization in .NET

查看:166
本文介绍了在.NET彩色图像量化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望减少在C#的位图的唯一的颜色数量。

I want to reduce the number of unique colors of a bitmap in c#.

我想这样做的原因是,它最初有三个颜色,但由于多种因素(包括COM pression)创建的映像现在已经超过三种颜色(即相邻像素已经影响到对方)

The reason I want to do this is that an image which is initially created with three color but due to many factors (including compression) has now more than three colors (i.e neighbour pixels has affected each other)

怎么做,你知道吗?

将溶液说不定东西整个位图从RGB转换为索引颜色系统或者能够应用于单个像素一些功能

The solution maybe something to convert the whole bitmap from RGB to Indexed color system or some function that can be applied to a single pixel.

任何GDI +或Emgu(OpenCV的)解决方案是为我好。

Any GDI+ or Emgu (opencv) solutions are good for me.

推荐答案

查看nQuant在的http:// nquant 。codeplex.com 。这将产生质量比code MSDN文章说马格努斯引用高得多。它还采用了阿尔法层考虑,而MSDN文章只判断RGB。来源$ C ​​$ c是可用,还有一个附带的<一个href="http://www.mattwrock.com/post/2011/09/05/Convert-32-bit-PNGs-to-high-quality-8-bit-PNGs-with-C.aspx"相对=nofollow>博客文章,讨论了code和算法的细节。

Check out nQuant at http://nquant.codeplex.com. This yields much higher quality than the code in the MSDN article that Magnus references. It also takes the Alpha layer into consideration while the msdn article only evaluates RGB. Source code is available and there is an accompanying blog post that discusses the code and algorithm in detail.

这篇关于在.NET彩色图像量化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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