SlideShare uma empresa Scribd logo
1 de 50
Baixar para ler offline
Core image presentation
Core Image
   Making Instagram Like Effects
The Goods
 github.com/
  kylestew/
  Hipstaroid

 slidesha.re/
    WstkjL
github.com/
 kylestew/
 Hipstaroid

slidesha.re/
   WstkjL

               CEO - inVnt LLC
               Mobile Developer @ cx.com

                        @kyleRstewart
Pictwo   PicQuick
Quartz 2D   Core Image
WWDC 2012
Sessions 510 / 511
Hipstaroid
Core image presentation
What is Core Image?




Image processing framework for

  Images

  Video
Core image presentation
Why is it useful?




Filter chains

Optimized rendering
93 filters on iOS 6!
Runtime Introspection



 List available CoreImage filters

 List attributes on a filter

   Input data types

   Default input values
iOS <---> OS X


Very similar API between OS X and iOS

OS X has more filters

Extendable kernels in OSX
Flexible Inputs
Flexible Outputs
Powerful




Combine filters

Renders on the GPU
The Filters...
      Color Effects                      Stylize Filters

      Compositing Operations             Halftone Effects

      Geometry Adjustment                Transition Effects

      Tile Effects                       Generators

      Distortion Effects

      Blur and Sharpen Effects


https://developer.apple.com/library/mac/#documentation/graphicsimaging/
        reference/CoreImageFilterReference/Reference/reference.html
CISepiaTone
CIScreenBlendMode
CITwirlDistortion
CIGaussianBlur
Filter Block Diagram
Simple Example - Sepia Tone
Filter Chaining
Filter Chaining
CIContext
CoreImage renderer

Flexible rendering destination

  CGImageRef

  EAGLContext

  CVPixelBufferRef

  data
CPU vs GPU Context

GPU - fast, less accurate

CPU - slow, more accurate, larger image sizes

CPU can also be run in the background
Core image presentation
Hipstaroid
github.com/kylestew/Hipstaroid
Core image presentation
FilmSelectionViewController.m
DarkRoom.m
Film.h
Core image presentation
Inversion.m
Core image presentation
OldTimey.m
Core image presentation
BlackWhite.m




               ...
BlackWhite.m
Core image presentation
LowRez.m
Core image presentation
CameraViewController.m
CameraViewController.m
CameraViewController.m




                         ...
CameraViewController.m
github.com/
 kylestew/
 Hipstaroid

slidesha.re/
   WstkjL

               CEO - inVnt LLC
               Mobile Developer @ cx.com

                        @kyleRstewart

Mais conteúdo relacionado

Semelhante a Core image presentation

FGS 2011: Making A Game With Molehill: Zombie Tycoon
FGS 2011: Making A Game With Molehill: Zombie TycoonFGS 2011: Making A Game With Molehill: Zombie Tycoon
FGS 2011: Making A Game With Molehill: Zombie Tycoonmochimedia
 
Intel Performance Workshop @ CES 2020
Intel Performance Workshop @ CES 2020Intel Performance Workshop @ CES 2020
Intel Performance Workshop @ CES 2020Low Hong Chuan
 
Presentation 20110918 after effect
Presentation 20110918   after effectPresentation 20110918   after effect
Presentation 20110918 after effectKuanhung Chen
 
Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016
Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016
Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016Codemotion
 
UplinQ - qualcomm® snapdragon™ processors a super gaming platform
UplinQ - qualcomm® snapdragon™ processors a super gaming platformUplinQ - qualcomm® snapdragon™ processors a super gaming platform
UplinQ - qualcomm® snapdragon™ processors a super gaming platformSatya Harish
 
Qualcomm Snapdragon Processors: A Super Gaming Platform
Qualcomm Snapdragon Processors: A Super Gaming Platform Qualcomm Snapdragon Processors: A Super Gaming Platform
Qualcomm Snapdragon Processors: A Super Gaming Platform Qualcomm Developer Network
 
Adobe AIR - Mobile Performance – Tips & Tricks
Adobe AIR - Mobile Performance – Tips & TricksAdobe AIR - Mobile Performance – Tips & Tricks
Adobe AIR - Mobile Performance – Tips & TricksMihai Corlan
 
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...Intel® Software
 
Threading Successes 01 Intro
Threading Successes 01   IntroThreading Successes 01   Intro
Threading Successes 01 Introguest40fc7cd
 
Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...
Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...
Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...Joone Hur
 
TestUpload
TestUploadTestUpload
TestUploadZarksaDS
 
SeConf2015: Advanced Automated Visual Testing With Selenium
SeConf2015: Advanced Automated Visual Testing With SeleniumSeConf2015: Advanced Automated Visual Testing With Selenium
SeConf2015: Advanced Automated Visual Testing With Seleniumadamcarmi
 
Introduction to Software Defined Visualization (SDVis)
Introduction to Software Defined Visualization (SDVis)Introduction to Software Defined Visualization (SDVis)
Introduction to Software Defined Visualization (SDVis)Intel® Software
 
Advanced Silverlight
Advanced SilverlightAdvanced Silverlight
Advanced Silverlightrsnarayanan
 
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.ozlael ozlael
 
426 lecture6a osgART Development
426 lecture6a osgART Development426 lecture6a osgART Development
426 lecture6a osgART DevelopmentMark Billinghurst
 
Tuning For Deep Learning Inference with Intel® Processor Graphics | SIGGRAPH ...
Tuning For Deep Learning Inference with Intel® Processor Graphics | SIGGRAPH ...Tuning For Deep Learning Inference with Intel® Processor Graphics | SIGGRAPH ...
Tuning For Deep Learning Inference with Intel® Processor Graphics | SIGGRAPH ...Intel® Software
 

Semelhante a Core image presentation (20)

FGS 2011: Making A Game With Molehill: Zombie Tycoon
FGS 2011: Making A Game With Molehill: Zombie TycoonFGS 2011: Making A Game With Molehill: Zombie Tycoon
FGS 2011: Making A Game With Molehill: Zombie Tycoon
 
Intel Performance Workshop @ CES 2020
Intel Performance Workshop @ CES 2020Intel Performance Workshop @ CES 2020
Intel Performance Workshop @ CES 2020
 
Hacking for salone: drone races
Hacking for salone: drone racesHacking for salone: drone races
Hacking for salone: drone races
 
Presentation 20110918 after effect
Presentation 20110918   after effectPresentation 20110918   after effect
Presentation 20110918 after effect
 
Pc54
Pc54Pc54
Pc54
 
Adobe MAX Recap
Adobe MAX RecapAdobe MAX Recap
Adobe MAX Recap
 
Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016
Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016
Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016
 
UplinQ - qualcomm® snapdragon™ processors a super gaming platform
UplinQ - qualcomm® snapdragon™ processors a super gaming platformUplinQ - qualcomm® snapdragon™ processors a super gaming platform
UplinQ - qualcomm® snapdragon™ processors a super gaming platform
 
Qualcomm Snapdragon Processors: A Super Gaming Platform
Qualcomm Snapdragon Processors: A Super Gaming Platform Qualcomm Snapdragon Processors: A Super Gaming Platform
Qualcomm Snapdragon Processors: A Super Gaming Platform
 
Adobe AIR - Mobile Performance – Tips & Tricks
Adobe AIR - Mobile Performance – Tips & TricksAdobe AIR - Mobile Performance – Tips & Tricks
Adobe AIR - Mobile Performance – Tips & Tricks
 
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
 
Threading Successes 01 Intro
Threading Successes 01   IntroThreading Successes 01   Intro
Threading Successes 01 Intro
 
Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...
Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...
Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...
 
TestUpload
TestUploadTestUpload
TestUpload
 
SeConf2015: Advanced Automated Visual Testing With Selenium
SeConf2015: Advanced Automated Visual Testing With SeleniumSeConf2015: Advanced Automated Visual Testing With Selenium
SeConf2015: Advanced Automated Visual Testing With Selenium
 
Introduction to Software Defined Visualization (SDVis)
Introduction to Software Defined Visualization (SDVis)Introduction to Software Defined Visualization (SDVis)
Introduction to Software Defined Visualization (SDVis)
 
Advanced Silverlight
Advanced SilverlightAdvanced Silverlight
Advanced Silverlight
 
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.
 
426 lecture6a osgART Development
426 lecture6a osgART Development426 lecture6a osgART Development
426 lecture6a osgART Development
 
Tuning For Deep Learning Inference with Intel® Processor Graphics | SIGGRAPH ...
Tuning For Deep Learning Inference with Intel® Processor Graphics | SIGGRAPH ...Tuning For Deep Learning Inference with Intel® Processor Graphics | SIGGRAPH ...
Tuning For Deep Learning Inference with Intel® Processor Graphics | SIGGRAPH ...
 

Último

VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 

Último (20)

VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 

Core image presentation

Notas do Editor

  1. \n
  2. I geek out about Core Image on a regular basis\nExcited!\nPlease interrupt me with questions\n
  3. download links for the source and presentation\n(on next page)\n
  4. Hi!\nI&amp;#x2019;m an iOS dev nerd - love this stuff\n\nCEO\n\nMobile Dev @ CX\n\nHit me on Twitter\n
  5. Experience working with photos and effects...\n\nPictwo (in market) - blends two photos together\nFeatured by Apple for 2 weeks in &amp;#x201C;New and Noteworthy&amp;#x201D;\n\nPicQuick is shipping in a few weeks\nCurated effects to your photos\nWe&amp;#x2019;ve created unique effects not seen anywhere else\n\nWhile creating these two apps I&amp;#x2019;ve tried almost every way to create effects on image in iOS \nexcept raw data processing\nApple gives a lot of powerful tools for processing images\n\n\n
  6. Underlying Technologies\n\nPictwo uses Quartz 2D\n\nPicQuick uses Core Image\n\nPictwo will be migrated to Core Image because its superior for photo blending and effects\n\nThere are many reasons why its better for these applications\n\nThough at the time of Pictwo launch, Core Image wasn&amp;#x2019;t mature enough on iOS\n
  7. Full disclosure: much of this information is from sessions 510 &amp; 511 of WWDC 2012\n\n510 - Getting Started With Core Image\nVery good introduction to the basics\n\n511 - Core Image Techniques\nHow to get more power and performance out of Core Image\nUse of Core Image in games\n\nI&amp;#x2019;m going to take it a bit further with some detailed source code I&amp;#x2019;m excited to share\n
  8. Hipstaroid is a real time camera effects app\nGood example - shows applying effects to still images and live video\nAlso gives me to chance to show how to encapsulate multiple filters into recipes\n
  9. (quick demo)\nshows a live preview of the effect being applied\nshows a list of effects, applying the effect to a sample image\nhad fun designing some UI based on a 35mm camera\n
  10. Basically, Core Image performs some seriously complicated math on your image data\n\nConsist of filters that perform per pixel operations on image data\n\nCan be used for\n+ Images\n+ Video\n+ Effects in games\n+ other applications (e.g. analysis on NASA image data)\n(because it has flexible inputs and outputs)\n
  11. Games!!!\nOpenGL Textures with CoreImage\nFrom WWDC Session 511\n
  12. With Core Image you can chain filters &lt;-- most useful part\nChaining allows you to create unique effects\nCore Image optimizes those chains for you by doing complex matrix operations\n(math I don&amp;#x2019;t even want to think about)\n
  13. 93 filters on iOS 6 - greatly expanded from iOS 5\nThe reason I didn&amp;#x2019;t use Core Image for Pictwo\nSomething to keep in mind for previous OS support\nCore Image provides run time introspection methods to find out what is supported on device\n
  14. At runtime you can query CoreImage for a ton of information\n\nNeed to know which filters are available? use &amp;#x201C;filterNamesInCategory&amp;#x201D;\n\nNeed to know the inputs for a filter you are using? use &amp;#x201C;attributes&amp;#x201D;\n\nAttributes show\n+ key for filter\n+ data type of inputs\n+ default values, value ranges, and some specific information\n\nAllows you to write one code path that adapts to each specific filter type because the interface is standard\n
  15. API is interchangeable between OS X and iOS - usually just need to use NS equivalent classes\nOS X has 130 built in filters + extendable kernels so you can build your own\nI&amp;#x2019;ve found that by combining the 93 filters in iOS, I&amp;#x2019;ve never needed to create my own\n
  16. Plenty of source options for your image data\n+ photo library\n+ video feed\n+ image data in memory - stream straight from the web\n
  17. Can do more then still image and video processing\nSend to Open GL textures for effects in games\nRaw byte output for custom applications\n
  18. Combines filters when possible, you don&amp;#x2019;t have to worry about operations on matrices\nPipelines the filter operations through the GPU == speedy\n
  19. Core Image groups filters into categories\nSearch Core Image Filter Reference in Google or get link\n
  20. Example of: Color Effects filter\n
  21. Example of: Compositing Operations\nWill take 2 inputs - one of which is a generator here\n
  22. Example of: Distortion Effects\n\n
  23. Example of: Blur and Sharpen Effects\nThese are new in iOS 6 and are certainly the most important filter additions\nCore Image uses them as the basis for many filters, things like Bloom and Gloom\nAlmost every effect in PicQuick uses some sort of blur or sharpen effect\nNOTE: they are also the most computationally intense\n
  24. I like to think of Core Images filters as block diagrams\n\nAll effects provide an output\nMost will take an input (not generators)\nCompositing filters take two inputs\nMost will have one or more inputs that affect their operation - parameters\n\nThink of filters as a block you can flow your image data through\n
  25. Source image data will always be a CIImage\nCreating a filter is easy, just pass in the filter name as a string\nFilters use key-values for all inputs and outputs\nWith the Sepia tone filter, we set the input image (our source image) and an intensity value\nThe effect can be varied by changing that intensity value\nA CI Context is prepared in order to be used for rendering\nThe results are rendered to a CGImage and then converted to a UIImage\nUIImage can be presented easily on screen\n
  26. How do we chain filters?\nVery simple!\nJust need to hook the output of one filter to the input of another filter\n
  27. This is an extension of the Sepia tone example\nWe add a hue Filter to the filter chain\nSet the input image of the hue filter to the output image of the sepia filter\nUse the hue filter as the output image when rendering\n
  28. The CIContext is what does the rendering for CoreImage\nIts flexible in where it can render\nStill images - CGImage\nEAGLContext - OpenGL, the fastest way to get your effects on screen\nCVPixelBufferRef - back into a video stream\ndata - your own custom implementation\n\n\n
  29. CIContext can run on the GPU or the CPU\nIt defaults to the GPU\nGPU is fast, but not as accurate as the CPU\nCPU is slower, but is more accurate and can handle larger image sizes\nCPU can also be run in the background after a users closes your app\nUse CPU when you don&amp;#x2019;t have to present the output to users right away\n
  30. Thats the basics, enough to build the sample app I showed\nI think Core Image is pretty neat\nStill not convinced CoreImage is the way to go for image processing on iOS?\nLets see it in action...\n
  31. (switch to XCode)\n
  32. Start with: Film Selection view\nApplies the filter stack (recipe) to a still image (puppy)\nComposed of: horizontal slide-able UIScrollView with a background to make it look like film\nEach preview is a UIButton with the image set as the rendered output of the recipe\n
  33. FilmSelectionViewController.m\nUsing NSOperationQueues to keep rendering off the main UI\nSending a film and source image to the DarkRoom so it can apply the effect\n(simple here)\n
  34. DarkRoom.m\nTakes a Film object and source image \nGenerates a UIImage output from them\nThe Film image is simply a CIFilter object (like the sample before)\nWe use the source size (extent) to set the output size\nDon&amp;#x2019;t forget to use CFRelease or you will leak even with ARC\n
  35. Film.h\nWhat is the Film object?\nSimple subclass of CIFilter that only defines one important piece (line 2)\nAll the effects (films) derive from this class\n
  36. Simplest Film:\nSimply inverts each pixel\n
  37. To make your own CIFilter you simply override the outputImage method\nThis is how Apple builds there own filters\nThere are other optional methods you can override, but this one has to be done in order to provide output\nIn this case: creates a CIColorInvert filter and ties the inputImage into it, then returns the output\n
  38. Sepia Tone + Vignette\nGives it the look of a photograph that has faded, especially at the edges\n
  39. This time we have to CIFilter objects, so they need to be connected together (as shown in previous example)\nThe CISepiaTone filter takes the inputImage as its inputImage\nThe CIVignette filter takes the CISepiaTone&amp;#x2019;s output as its inputImage.\nThe vignette filters output is the Film&amp;#x2019;s output\npiece of cake!\nBoth these filters also have inputs (explain)\nRadius is a Distance attribute so it needs to be scaled. \nI usually scale along the width.\n
  40. B&amp;W\n
  41. \n
  42. \n
  43. Low Rez\n
  44. \n
  45. (how is the film applied in real time?)\n
  46. Need an AVCaptureSession to bring in the camera feed\n(was messing with grabbing still images from the feed)\nCache the CoreImage context so it only needs to be created once\nStore the currently selected film\n
  47. Setup an AVCapture session\nThis is my first time, not an expert\nThis is the important piece, we are adding a data output in 32BGRA format\nand we are setting up a callback to our code for each captured image frame\n
  48. AVCaptureSession (once its setup) will callback your code for each frame captured\ncaptureOutput:didOutputSampleBuffer:fromConnection\nWhat it gives you is a CVPixelBuffer\nYou always need a CIImage for input to your CoreImage filters\nHere we are converting it and rotating it to display correctly\n
  49. Now for the magic...\nPass the core image frame into the selected film, and simply render its output\nThe CIContext is used to do this\nSurprisingly making a UIImage is fast enough to get near 30fps\nTo speed this up, you can replace the imageWithCGImage with some OpenGL code that renders directly to an EAGLcontext\nI wanted to keep this code sample simple\nOther then setting up a camera capture session, this is all there is too doing realtime effects on your camera preview\nEnjoy the source, its yours!\n
  50. Hi!\nI&amp;#x2019;m an iOS dev nerd - love this stuff\n\nCEO\n\nMobile Dev @ CX\n\nHit me on Twitter\n