将每像素 24 位转换为 8 位 tiff
我想将 24 位每像素(Rgb)int 转换为每像素 8 位 tiff 图像是否有任何代码可以转换,请分享或告诉我 c Sharp 中的算法
i want to convert a 24 bit per pixcel(Rgb) int 8 bit per pixel tiff image is there any code to convert please share or tell me the algo in c sharp
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你的意思是如何将 RGB 图像转换为灰度图像?一个简单的基于感知的方法是将其转换为 YIQ 色彩空间并丢弃色度信息。您可以通过以下等式生成亮度部分:
Do you mean how do you turn a RGB image into a greyscale one? A simple perceptually-based method is to transform it into YIQ colorspace and discard the chroma information. You can generate the luminance portion by this equation:
这是一个很好的 C# 代码教程:
http ://www.switchonthecode.com/tutorials/csharp-tutorial-convert-a-color-image-to-grayscale
免责声明:我在 Atalasoft 工作。
如果您对商业解决方案感兴趣,可以使用 DotImage 来实现。转换单帧 tiff 的代码是
如果您有多页 TIFF,则只需循环它们。
Here is a good tutorial with C# code:
http://www.switchonthecode.com/tutorials/csharp-tutorial-convert-a-color-image-to-grayscale
Disclaimer: I work at Atalasoft.
If you are interested in a commercial solution, you can do this with DotImage. The code to convert a single framed tiff is
If you have multipaged TIFFs, you just need to loop through them.
假设您想要从 24 位彩色图像转换为 8 位彩色图像,那么您需要研究抖动算法。
此页面描述了一个非常简单的抖动算法: http://wwwhome.cs.utwente .nl/~schooten/图形/
它的质量不是很高,但是作为第一次尝试很容易理解。
之后,尝试一下 Floyd-Steinberg 抖动算法。
http://en.wikipedia.org/wiki/Floyd%E2%80% 93Steinberg_dithering
Assuming you mean you want to convert from a 24 bit colour image to an 8 bit colour image, then you'll need to look into dithering algorithms.
A very simple dithering algorithm is described on this page: http://wwwhome.cs.utwente.nl/~schooten/graphics/
It's not very high quality, but it's easy to understand as a first attempt.
After that, have a go at the Floyd-Steinberg dithering algorithm.
http://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dithering