Image resizing efficiency in C# and .NET 3.5

后端 未结 6 1032
傲寒
傲寒 2020-12-31 05:24

I have written a web service to resize user uploaded images and all works correctly from a functional point of view, but it causes CPU usage to spike every time it is used.

6条回答
  •  一向
    一向 (楼主)
    2020-12-31 06:08

    Image processing is usually an expensive operation. You have to remember that a 32 bit color image is expanded in memory into 4 * pixel width * pixel height before your app even starts any kind of processing. A spike is definitely to be expected especially when doing any kind of pixel processing.

    That being said, the only place i could see you in being able to speed up the process or lowering the impact on your processor is to try a lower quality interpolation mode.

提交回复
热议问题