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.
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.
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).
Run times on a 4th gen iPod touch, as reported by Instruments, are the following:
kCGInterpolationLow: 969 msec
kCGInterpolationMedium: 1690 msec
kCGInterpolationHigh: 2694 msec
kCGInterpolationNone: 545 msec
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With