简体   繁体   English

图像缩放(可编写脚本的图像处理系统)

[英]Scaling of image (scriptable image processing system)

I want to scale images to 400x400 (I am creating thumbnails). 我想将图像缩放到400x400(我正在创建缩略图)。 I am using the Scriptable Image Processing System (SIPS) in a Cocoa application, but the problem is poor efficiency. 我在Cocoa应用程序中使用了可编写脚本的图像处理系统(SIPS),但问题是效率低下。 SIPS takes 70-90% CPU while converting 300 images in 20 seconds. SIPS占用70-90%的CPU,同时在20秒内转换300张图像。 Should I use the CIImage class ( CIImage is the type required to use the various GPU-optimized Core Image filters) or NSImage class? 我应该使用CIImage类( CIImage是使用各种GPU优化的Core Image滤镜所需的类型)还是NSImage类? Can anyone suggest a better method? 谁能提出更好的方法?

A very simple and fast way to generate thumbnails on OS X is to use QLThumbnailImageCreate . 在OS X上生成缩略图的一种非常简单快捷的方法是使用QLThumbnailImageCreate
It's just one line of code so you can easily try out how it compares to SIPS & Core Image. 它仅是一行代码,因此您可以轻松地尝试将其与SIPS和Core Image进行比较。

I tried thumbnail genration using NSImage , CIImage and sips. 我尝试使用NSImage,CIImage和sips进行缩略图生成。 All are taking same CPU (70-90%) usage but sips is faster. 所有人都使用相同的CPU(70-90%)使用率,但喝点速度更快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM