core-image

Key differences between Core Image and GPUImage

倾然丶 夕夏残阳落幕 提交于 2019-12-18 10:35:19
问题 What are the major differences between the Core Image and GPUImage frameworks (besides GPUImage being open source)? At a glance their interfaces seem pretty similar... Applying a series of filters to an input to create an output. I see a few small differences, such as the easy to use LookupFilter that GPUImage has. I am trying to figure out why someone would choose one over the other for a photo filtering application. 回答1: As the author of GPUImage, you may want to take what I say with a

How is filters UIScrollView/UICollectionView in Apple's Photos app implemented that it opens so fast?

╄→尐↘猪︶ㄣ 提交于 2019-12-18 05:23:18
问题 I'm not asking about the exact code but the overall idea. Here is my problem: I'm trying to create something similar to filter choosing UI in Photos app. I've tried multiple approaches and all of them have their drawbacks. 1) I've tried using Operation and OperationQueue with a collection view, which prefetching is enabled. This loads the viewController fast but drops frames while scrolling. 2) Right now I'm using a scroll view and GCD but it loads the viewController too long (because it

Applying a CIFilter to a CALayer

孤街浪徒 提交于 2019-12-18 02:57:29
问题 CI Filters are now available in iOS 5, and I'm trying to apply one to a CALayer, the way you'd do it on Mac. Here's my code: CALayer *myCircle = [CALayer layer]; myCircle.bounds = CGRectMake(0,0,30,30); myCircle.position = CGPointMake(100,100); myCircle.cornerRadius = 15; myCircle.borderColor = [UIColor whiteColor].CGColor; myCircle.borderWidth = 2; myCircle.backgroundColor = [UIColor whiteColor].CGColor; CIFilter *blurFilter = [CIFilter filterWithName:@"CIDiscBlur"]; [blurFilter setDefaults]

How can I map Photoshop's level adjustment to a Core Image filter?

天涯浪子 提交于 2019-12-17 22:43:34
问题 I'm mapping several photoshop elements to CIFilter, the only one I'm having trouble with is this Levels Adjustment: Which CI Filter (or combination of filters) would let me utilize the 16, 1.73, 239 & 39/245 above in the first example or the 31, 1.25, 255 30/255 in the second example. I believe this is a kind of shadow/black and white level adjustment. Any help appreciated. 回答1: By adapting the formula from this page: http://http.developer.nvidia.com/GPUGems/gpugems_ch22.html, I believe you

How to Convert UIImage to CIImage and vice versa

╄→гoц情女王★ 提交于 2019-12-17 21:49:02
问题 I'm trying to get CIImage from ImageView that display on the screen. UIImage *image = myImageView.image; convert image UIImage to CIImage . CIImage *cImage = [....]; How to do this? 回答1: CIImage *ciImage = [UIImage imageNamed:@"test.png"].CIImage; UIImage *uiImage = [[UIImage alloc] initWithCIImage:ciImage]; To fix the case where myUIImage.CIImage returns nil like [UIImageView image] , you can instead do [CIImage imageWithCGImage:myUIImage.CGImage] – Dylan Hand Swift version: let ciImage =

Convert RGB image to 1 channel image (black/white)

老子叫甜甜 提交于 2019-12-17 19:55:44
问题 How can I convert RGB image to 1 channel image (black/white) using ios5? Input image is usually a photo of a book page. Goal is to reduce the size of a photocopy by converting it to the 1 channel image. 回答1: If I understand your question, you want to apply a black and white thresholding to the image based on a pixel's luminance. For a fast way of doing this, you could use my open source GPUImage project (supporting back to iOS 4.x) and a couple of the image processing operations it provides.

CIFilter output image nil

给你一囗甜甜゛ 提交于 2019-12-17 14:01:55
问题 I am using core image and I am applying a CIFilter sepia tone to my image. I run a filter once in viewDidLoad and then immediately call another function that adds the filter again. For some reason, when I try to access the output image, the app crashes and says the output image is nil. Anyone know why this is happening? Thanks import UIKit class ViewController: UIViewController { @IBOutlet weak var myimage: UIImageView! override func viewDidLoad() { super.viewDidLoad() // Do any additional

CIFilter output image nil

人走茶凉 提交于 2019-12-17 14:01:30
问题 I am using core image and I am applying a CIFilter sepia tone to my image. I run a filter once in viewDidLoad and then immediately call another function that adds the filter again. For some reason, when I try to access the output image, the app crashes and says the output image is nil. Anyone know why this is happening? Thanks import UIKit class ViewController: UIViewController { @IBOutlet weak var myimage: UIImageView! override func viewDidLoad() { super.viewDidLoad() // Do any additional

Does iOS 5 support blur CoreImage fiters?

Deadly 提交于 2019-12-17 03:38:43
问题 According to the documentation it should support blurring, note the "Available in iOS 5.0 and later": CIFilter Class Reference But according to the device, it doesn't: [CIFilter filterNamesInCategory:kCICategoryBlur]; returns nothing. According to the following only these filters are available on my iPhone and Simulator (which are both running 5.0): [CIFilter filterNamesInCategory:kCICategoryBuiltIn] CIAdditionCompositing, CIAffineTransform, CICheckerboardGenerator, CIColorBlendMode,

Does iOS 5 support blur CoreImage fiters?

假如想象 提交于 2019-12-17 03:36:14
问题 According to the documentation it should support blurring, note the "Available in iOS 5.0 and later": CIFilter Class Reference But according to the device, it doesn't: [CIFilter filterNamesInCategory:kCICategoryBlur]; returns nothing. According to the following only these filters are available on my iPhone and Simulator (which are both running 5.0): [CIFilter filterNamesInCategory:kCICategoryBuiltIn] CIAdditionCompositing, CIAffineTransform, CICheckerboardGenerator, CIColorBlendMode,