I just have a look on CoreImage framework on iOS 5, found that it's easy to add an effect to whole image. I wonder if possible to add an effect on special part of image (a rectangle). for example add gray scale effect on partial of image/
I look forward to your help.
Thanks, Huy
Watch session 510 from the WWDC 2012 videos. They present a technique how to apply a mask to a CIImage
. You need to learn how to chain the filters together. In particular take a look at:
CICrop
, CILinearGradient
, CIRadialGradient
(could be used to create the mask)CISourceOverCompositing
(put mask images together)CIBlendWithMask
(create final image)The filters are documented here:
https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With