本文介绍了C中最快的抖动/半色调库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个自定义瘦客户端服务器,为其客户端提供呈现的网页。服务器在多核Linux机器上运行,Webkit提供html渲染引擎。

I'm developing a custom thin-client server that serves rendered webpages to its clients. Server is running on multicore Linux box, with Webkit providing the html rendering engine.

唯一的问题是客户端显示受限于4位(16色)灰度调色板。我目前正在使用LibGraphicsMagick抖动图像(RGB-> 4bit灰度),这是服务器性能的明显瓶颈。分析表明,超过70%的时间用于运行GraphicsMagick抖动函数。

The only problem is the fact that clients display is limited with a 4bit (16 colors) grayscale palette. I'm currently using LibGraphicsMagick to dither images (RGB->4bit grayscale), which is an apparent bottleneck in the server performance. Profiling shows that more than 70% of time is spent running GraphicsMagick dithering functions.

我已经探索了stackoverflow和Interwebs的高性能解决方案,但似乎没有人在各种图像处理库和抖动解决方案上做过任何基准测试。

I've explored stackoverflow and the Interwebs for a good high performance solution, but it seems that nobody did any benchmarks on various image manipulation libraries and dithering solutions.

我会更乐意找到:


  1. 关于抖动/半色调/量化RGB图像到4位灰度的最高性能库是什么。

  2. 是否有任何特定的抖动库或任何公共域代码片段,您可以指向我to?

  3. 你喜欢哪些库来操作图形以获得高性能?

首选C语言库。

推荐答案

从Adisak提供的列表中,没有任何测试,我打赌。 Afterstep人对速度很着迷,并且还描述了一个聪明的算法。

From the list provided by Adisak, without any testing, I would bet on AfterImage. The Afterstep people are obsessed with speed, and also described a clever algorithm.

如果您的服务器可以配备一个像样的PCI-express显卡,您可以采取另一种方法以OpenGL为特色的卡片。 是Nvidia的一些规格。搜索索引模式。您可以做的是选择16或256色显示模式,将图像渲染为平面多边形(如立方体的一侧)上的纹理,然后再读回帧。

You could take an alternative approach, if your server could be equipped with a decent PCI-express graphics card featuring OpenGL. Here are some specs from Nvidia. Search for "index mode". What you could do is select a 16 or 256 color display mode, render your image as a texture on a flat polygon (like the side of cube) and then read the frame back.

从OpenGL卡读取帧时,从卡中获取带宽非常重要,因此需要PCI-express。正如文档所说,你还必须在索引模式中选择你的颜色以获得不错的效果。

When reading a frame from an OpenGL card, it is important that bandwidth is good from the card, hence the need for PCI-express. As the documentation says, you also have to choose your colors in indexed mode for decent effects.

这篇关于C中最快的抖动/半色调库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 00:38