31

i am working on a project which requires some image processing, i also asked question regarding it and i got very good solution here is the link create whole new image in iOS by selecting different properties

but now i want to learn this in more detail and i am confused from where should i start learning quartz 2d or core animation or core graphics or core image

apple documents say regarding quartz 2d that

The Quartz 2D API is part of the Core Graphics framework, so you may see Quartz referred to as Core Graphics or, simply, CG.

and apple docs says about core graphics that

The Core Graphics framework is a C-based API that is based on the Quartz advanced drawing engine.

this is confusing how they both relate to each other...

now core animation contains all concepts of coordinates, bounds, frames etc which is also required in drawing images

and core image is introduced in ios 5

from where should i start learning or i which sequence i start learning all these.

Community
  • 1
  • 1
supera
  • 580
  • 5
  • 13

2 Answers2

61

Quartz and Core Graphics are effectively synonymous. I tend to avoid using "Quartz" because the term is very prone to confusion (indeed, the framework that includes Core Animation is "QuartzCore," confusing matters further).

I would say:

  • Learn Core Graphics (CoreGraphics.framework) if you need high performance vector drawing (lines, rectangles, circles, text, etc.), perhaps intermingled with bitmap/raster graphics with simple modifications (e.g. scaling, rotation, borders, etc.). Core Graphics is not particularly well suited for more advanced bitmap operations (e.g. color correction). It can do a lot in the way of bitmap/raster operations, but it's not always obvious or straightforward. In short, Core Graphics is best for "Illustrator/Freehand/OmniGraffle" type uses.

  • Learn Core Animation (inside QuartzCore.framework) if, well, you need to animate content. Basic animations (such as moving a view around the screen) can be accomplished entirely without Core Animation, using basic UIView functionality, but if you want to do fancier animation, Core Animation is your friend. Somewhat unintuitively, Core Animation is also home to the CALayer family of classes, which in addition to being animatable allow you to do some more interesting things, like quick (albeit poorly performing) view shadows and 3D transforms (giving you what might be thought of as "poor man's OpenGL"). But it's mainly used for animating content (or content properties, such as color and opacity).

  • Learn Core Image (inside QuartzCore.framework) if you need high performance, pixel-accurate image processing. This could be everything from color correction to lens flares to blurs and anything in between. Apple publishes a filter reference that enumerates the various pre-built Core Image filters that are available. You can also write your own, though this isn't necessarily for the faint of heart. In short, if you need to implement something like "[pick your favorite photo editor] filters" then Core Image is your go-to.

Does that clarify matters?

hashier
  • 4,670
  • 1
  • 28
  • 41
Conrad Shultz
  • 8,748
  • 2
  • 31
  • 33
  • 1
    thanks a lot for your answer it is very useful, please help me regarding one more thing that i am trying to do in my ios app, user is allowed to select an image from library or cam and then user is allowed to apply borders and text and then it will be saved as whole new image, for borders i have created several different color borders in PS but i want borders to be created programmatically and also styled squared or rounded corners and all colors can be applied for this what should i learn first? – supera Feb 12 '12 at 14:41
  • 1
    I'd say go with Core Graphics. A hint: learn about clipping paths. You will use them to round corners. – Conrad Shultz Feb 12 '12 at 18:21
  • 7
    Oh, one more thing: I encourage you to take a little more care in the future on capitalization and punctuation. It's hard to read run-on sentences, and you will lose the attention of some potential answerers. – Conrad Shultz Feb 12 '12 at 18:24
  • Thanks a lot for the help, it is very very useful reply. I will try my best for capitalization and punctuation. Take care. – supera Feb 13 '12 at 05:43
  • i like to share another useful resource that will help more after reading this answer, here is the link https://developer.apple.com/library/mac/#referencelibrary/GettingStarted/GS_GraphicsImaging/_index.html – supera Feb 13 '12 at 06:31
  • 1
    @ConradShultz : You mentioned "Core Image (inside QuartzCore.framework)", but CoreImage is by itself a different framework: https://developer.apple.com/documentation/coreimage#overview – aksani56 Aug 20 '17 at 08:55
8

Core Animation is a technology that relies a lot more on OpenGL, which means its GPU-bound.

Core Graphics on the other hand uses the CPU for rendering. It's a lot more precise (pixel-wise) than Core Animation, but will use your CPU.

Arie Litovsky
  • 4,893
  • 2
  • 35
  • 40