tInterpolationQuality的ImageQuali

tInterpolationQuality的ImageQuali

本文介绍了使用CGContextSetInterpolationQuality的ImageQuality的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Quartz中 CGContextSetInterpolationQuality 方法的效果如何?

How effective is the CGContextSetInterpolationQuality method in Quartz?

它是否会影响图像的质量?如果是这样,到什么程度?

Does it affect the quality of the image? If so, to what extent?

我看不出内插图像和非内插图像之间的任何差异。

I can't see any difference between the interpolated and the non-interpolated image.

推荐答案

虽然这是一个老问题,但我最近做了一些关于 CGContextSetInterpolationQuality 的影响的基准测试它的结果可能是其他人感兴趣的。

Although this is a bit of an old question, I have recently done some benchmarking about the effects of CGContextSetInterpolationQuality and thought that its outcomes might be of interest to someone else.

在我的基准测试中,我绘制了一组6个不同的649x649 b& w位图图像来构建一组12不同的拼图瓷砖。位图图像按比例缩小5.0倍(即129.8x129.8),使其适合320x480显示器(视网膜显示比例)。

In my benchmark test, I draw a set of 6 different 649x649 b&w bitmap images to build a set of 12 different jigsaw puzzle tiles. The bitmap images are scaled down by a factor of 5.0 (i.e., to 129.8x129.8) to make them fit on a 320x480 display (at retina display scale).

据Instruments报道,第四代iPod touch的运行时间如下:

Run times on a 4th gen iPod touch, as reported by Instruments, are the following:


  • kCGInterpolationLow:969 msec

  • kCGInterpolationLow: 969 msec

kCGInterpolationMedium:1690毫秒

kCGInterpolationMedium: 1690 msec

kCGInterpolationHigh:2694毫秒

kCGInterpolationHigh: 2694 msec

kCGInterpolationNone:545毫秒

kCGInterpolationNone: 545 msec

至于视觉结果,如果你比较高或中等到低或无,差异是惊人的。甚至引人注目的IMO,None和Low之间的区别;而在这个特定的测试中,高和中之间的差异并不是特别明显。很清楚的是运行时间的差异,所以在我的特定情况下,我最终使用 kCGInterpolationMedium

As to the visual outcome, if you compare High or Medium to Low or None, the difference is staggering. Even noticeable, IMO, the difference between None and Low; while the difference between High and Medium is not particularly noticeable in this particular test. What is clear is the difference in run times, so that in my particular case, I ended up using kCGInterpolationMedium.

kCGInterpolationNone

kCGInterpolationLow

kCGInterpolationMedium

kCGInterpolationHigh

这篇关于使用CGContextSetInterpolationQuality的ImageQuality的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 09:32