Reputation: 16302
I have been reading a lot about pixel and vector graphics.
Have also read questions here on SO that discussed about this, most of which have been tagged with GPUImage
.
Still, I have not been able to find an answer regarding this.
My question is:
How can we be able to produce vector graphics for iOS?
Let's say, for example, we have an UIImage
, may it be a picture taken from the camera or an image that we created using CGContext
, is there an algorithm or a way where we could convert this into Vector graphic image?
Or: is there a way to create a vector image within iOS?
I am not here to ask for complete code; I would like to just get some pointer / directions in accomplishing this from those has the know-how. Sample code would be nice, which I doubt I would get, because prior to posting the question here, I have been searching for answers both on Google and here on SO.
Thanks in advance.
Upvotes: 2
Views: 2313
Reputation: 26395
It's a little unclear what you're asking, but I'll attempt to answer. If you want to draw vector graphics, you can do that with CoreGraphics. (aka Quartz 2D) It creates lines, curves, filled polygons, text, etc. If you have specific questions about how to something with CoreGraphics, please post that as a question with as much detail as you can.
If you want to save drawings that you've made with CoreGraphics in a vector format that other applications or operating systems can recognize, you can generate a PDF using CoreGraphics.
If you want to convert a photograph into a vector image, that's a very complicated thing to do. It is possible, but the results vary greatly. You will probably need to look up topics like edge detection, image segmentation, and other image analysis techniques.
Upvotes: 4