.NET 中最快的图像大小调整 [英] Fastest Image Resizing in .NET

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

问题描述

我需要最快的库来将完整尺寸的图像(有些高达 9MB)调整为多种尺寸.

场景如下:

  • 用户上传照片
  • FileSystemWatcher 正在监视放置位置的服务中运行(在 SAN 上)
  • 当出现新照片时,该服务会以全 JPEG 质量创建 4 个版本的图像:
    • 100 像素宽
    • 320 像素宽
    • 640 像素宽
    • 1280 宽

    如果库是 C/C++ 或其他任何东西,我不会大惊小怪,只要我可以通过 .NET 使用它就很酷.

    I'm not fussed if the library is C/C++ or anything else for that matter, as long as I can tap into it via .NET it's cool.

    此外,这还需要扩展到可能有 1,000 个活跃用户.

    Also this will need to scale to possibly 1,000 active users.

    让我知道你的想法:)

    推荐答案

    有很多文章展示了 这个基础.我使用了 Atalasoft 的组件,发现它们的质量非常好.调整大小和处理 JPEG 图像存在细微差别.

    There are a lot of articles out there showing the basics of this. I've used the components from Atalasoft and found them to be of pretty good quality. There are nuances to resizing and working with JPEG images.

    您似乎真的很关心性能,但您并没有真正提供足够的信息来帮助我们为您提出好的优化建议.无论您在做什么,您都需要进行全面的性能分析并了解运行缓慢的原因.在某些情况下速度较慢,但​​如果优化其他内容,可维护的图像处理代码可能没问题.

    You seem to be really concerned with performance but you don't really give enough information to help us suggest good optimizations for you. Whatever you are doing, you need to do a full performance analysis and understand what is running slow. In some cases slowish, but maintainable image processing code may be OK if other things are optimized.

    获得良好性能的一种解决方案是将需要转换的传入文件排队.添加更多机器以处理队列中的更多消息,或优化服务代码以获得更好的吞吐量.如果设计得当,处理大量用户其实并不难.

    One solution for good performance is to queue incoming files that need to be converted. Add more machines to handle more messages in the queue, or optimize the service code to get better throughput. It's really not that difficult to handle a large number of users if you get the design right.

    这篇关于.NET 中最快的图像大小调整的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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