I am making an application that uses basic core Graphics functions . The Application runs reasonably well on Ipad2, but there is a performance hit on Ipad3 due to retina display, which causes drawing to be done on number of pixels 4 times to the earlier. I tried some hacks to improve performance, but since drawing takes place on gestures in my code, I think I will have to switch on to some other alternative. I was wanting to ask if Core Image provides all the functionalities that can be performed using Core Graphics, so that I may use GPU Processing capability. If not, what could be the best alternative so that I can use the same functionalities with a better processing capability.
-
Are you 100% sure that the performance drop is because of the increased number of pixels? – zoul May 24 '12 at 07:23
-
Yes. Because the performance shows some improvement when some drawing operations are removed or portions of the screens are drawn instead of the whole screen. – user1414340 May 24 '12 at 07:41
2 Answers
Core Image and Core Graphics are very different. Core Image is an image processing technology. You can apply pre-made filters like sepia, black and white, and color invert, or you can create custom filters. Core Graphics is a rendering API utilizing Quartz 2D technologies that allows for complex drawing.
Brad Larson's GPUImage is a great alternative/addition to Core Image. You can find it here.
If you want improved performance, you can try a low level API like OpenGL. It's difficult to learn, but here are a few links to get you started:
- iPhone OpenGL ES – 8 Great Resources For Learning - From ManiacDev, self-explanatory
- OpenGL ES Programming Guide for iOS - Apple's own documentation, thorough, a good start
- iOS based OpenGL ES programming - Some more resources for getting started
- OpenGL ES 2.0 for iPhone Tutorial - Good Ray Wenderlich introduction
- Pro OpenGL ES for iOS - Great Apress book but not for beginners
A year late, I know, but take a look at WWDC 2010 Sessions on Core Animation: 424,and 425. Both are important, but there are some good details on performance tuning in 425 at about the 11:00 mark.
The short synopsis, is that there are three potential bottlenecks, and you need to identify, optimize, and keep iterating until you get a smooth 60 FPS. The potential bottlenecks are:
- read bandwidth
- write bandwidth
- processing / rendering passes.
The 425 session (Core Animation in Practice, Part 2) covers techniques for dealing with the above.

- 8,889
- 5
- 52
- 68