我应该使用什么图像处理库

发布于 2024-12-03 05:19:45 字数 845 浏览 0 评论 0原文

我一直在阅读 https://stackoverflow.com/questions/158756/what- is-the-best-image-manipulation-library 并尝试了一些库,现在正在寻找最适合我们需求的输入。我将首先描述我们当前的环境和问题。

我们有一个系统需要从大的原始图像中调整大小和裁剪大量图像。我们每天在 2 台功能强大的服务器上处理 50 000 多张图像。今天我们使用 WebSupergoo 的 ImageGlue,但我们一点也不喜欢它,它很慢并且时不时地挂起服务(这是另一个未回答的堆栈溢出问题)。我们有一个线程 Windows 服务,它使用 Microsoft ThreadPool 在 8 核机器上尽可能地调整大小。

我尝试过 AForge,它运行得非常好,加载速度更快,而且从未崩溃或发生任何其他情况。但我在一些图像上遇到了质量问题。这是由于我使用了 ofc 的算法,因此可以进行调整。但我们想睁大眼睛看看这是否是正确的方法。

所以:

  • 它需要是 c# .net 并在 Windows 服务中运行。 (因为我们不会更改服务的其余部分,仅更改图像处理)
  • 它需要很好地处理线程环境。
  • 我们非常需要它快一点,因为今天它太慢了。但我们还想要良好的质量和较小的文件大小,因为图像稍后会显示在有大量访问者的网页上,并且需要良好的质量。

因此,我们对快速获得优质质量的能力有很多要求,并且即使可以通过压缩进行一点调整,也要保持较低的文件大小。

关于使用哪个库有什么意见或建议吗?

I have been reading https://stackoverflow.com/questions/158756/what-is-the-best-image-manipulation-library And tried a few libraries and are now looking for inputs on what is the best for our need. I will start by describing our current setting and problems.

We have a system that needs to resize and crop a large amount of images from big original images. We handle 50 000+ images every day on 2 powerfull servers. Today we use ImageGlue from WebSupergoo but we don't like it at all, it is slow and hangs the service now and then (Its in another unanswered stack overflow question). We have a threaded windows service that uses Microsoft ThreadPool to resize as much as possible on the 8 core machines.

I have tried AForge and it went very well it was loads faster and never crashed or anything. But I had problems with quality on a few images. This due to what algorithms I used ofc so can be tweaked. But want to widen our eyes to see if thats the right way to go.

so:

  • It needs to be c# .net and run in a windows service. (Since we wont change the rest of the service only image handling)
  • It needs to handle threaded environment well.
  • We have a great need of it being fast since today its too slow. But we also want good quality and small filesize since the images are later displayed on webpage with loads of visitors and needs good quality.

So we have a lot of demands on ability to get god quality at a fast pace, and also secondary keep filesizes lowered even if that can be adjusted with compression a bit.

Any comments or suggestions on what library to use?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

摘星┃星的人 2024-12-10 05:19:45

据我了解,您希望仍然使用 C#,但提供替代方案。

根据您正在执行的工作量,处理图像的最快方法是完全在 GPU 上完成(这将卸载大部分像素工作)。您可以通过可从服务调用的托管 C++ 与 CUDA 进行互操作。或者使用 DirectX 表面和渲染目标(您可以拥有抗锯齿功能和开箱即用的所有高质量内容)。

但是,在执行任何操作之前,请确保您的工作负载主要由三线性/双线性调整大小主导,而不是由图像的编码/解码主导。顺便说一句,每台服务器上至少需要一个快速 nVidia 显卡来进行卸载(便宜的 GTX 460 就足够了)。

I understand it sais that you want to still use C# but providing an alternative.

Depending on the ammount of work you are doing, the fastest way to manipulate images is doing it entirely on a GPU (that would offload most of the pixel work). You can interoperate with CUDA from Managed C++ that you can call from your service. Or use DirectX surfaces and rendering targets (you can have antialiasing and all the high-quality stuff out-of-the-box).

However, before doing anything makes sure your workload is dominated by the trilinear/bilinear resizing and not by the encoding/decoding of the image. BTW you will need at least one fast nVidia videocard on each server to do the offloading (cheap GTX 460 would be more than enough).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文