Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

confusion regarding quartz2d, core graphics, core animation, core images

Tags:

ios

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.

like image 222
supera Avatar asked Feb 12 '12 11:02

supera


2 Answers

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?

like image 178
Conrad Shultz Avatar answered Sep 22 '22 12:09

Conrad Shultz


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.

like image 42
Arie Litovsky Avatar answered Sep 19 '22 12:09

Arie Litovsky