CIImage is an image class from Apple's CoreImage framework. It is supplemented by other CoreImage classes -- such as CIFilter, CIContext, CIVector and CIColor. Although a CIImage holds image data, it is not an image. Core Image doesn’t actually render an image until it is told to do so. This “lazy evaluation” method allows Core Image to operate as efficiently as possible.
Questions tagged [ciimage]
294 questions
95
votes
1 answer
Interpret XMP-Metadata in ALAssetRepresentation
When a user makes some changes (cropping, red-eye removal, ...) to photos in the built-in Photos.app on iOS, the changes are not applied to the fullResolutionImage returned by the corresponding ALAssetRepresentation.
However, the changes are…

andreas
- 1,045
- 7
- 7
34
votes
3 answers
Getting a CGImage from CIImage
I have a UIImage which is loaded from a CIImage with:
tempImage = [UIImage imageWithCIImage:ciImage];
The problem is I need to crop tempImage to a specific CGRect and the only way I know how to do this is by using CGImage.
The problem is that in…

tagyro
- 1,638
- 2
- 21
- 36
27
votes
11 answers
How to blur an existing image in a UIImageView with Swift?
The setup is simple.
A ViewController with UIImageView that has an image assigned.
A UIButton that when clicked blurs the image in the UIImageView.
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var bg:…

Mark Moeykens
- 15,915
- 6
- 63
- 62
26
votes
6 answers
Creating a blur effect in iOS7
I have been searching for an answer to this question in a few hours now, and I just can't figure it out. I want to add a gaussian blur effect to the image when i press the button "Button". The user is the one that is adding the image.
I have…

user2891448
- 363
- 1
- 4
- 7
23
votes
13 answers
Apply Black and White Filter to UIImage
I need to apply a black-and-white filter on a UIImage. I have a view in which there's a photo taken by the user, but I don't have any ideas on transforming the colors of the image.
- (void)viewDidLoad {
[super viewDidLoad];
…

user3422862
- 233
- 1
- 2
- 5
18
votes
3 answers
Unable to convert CIImage to UIImage in Swift 3.0
I am making image form QR Code by using following code:
func createQRFromString(str: String) -> CIImage? {
let stringData = str.dataUsingEncoding(NSUTF8StringEncoding)
let filter = CIFilter(name: "CIQRCodeGenerator")
…

Rahul
- 5,594
- 7
- 38
- 92
11
votes
4 answers
Drawing a CIImage is too slow
I'm creating an app that requires real-time application of filters to images. Converting the UIImage to a CIImage, and applying the filters are both extremely fast operations, yet it takes too long to convert the created CIImage back to a CGImageRef…

Jojodmo
- 23,357
- 13
- 65
- 107
10
votes
1 answer
Applying MPSImageGaussianBlur with depth data
I am trying to create an imitation of the portrait mode in Apple's native camera.
The problem is, that applying the blur effect using CIImage with respect to depth data, is too slow for the live preview I want to show to the user.
My code for this…

Eyzuky
- 1,843
- 2
- 22
- 45
10
votes
2 answers
How to preserve original photo metadata when editing PHAssets?
I am editing photos via PhotoKit but I discovered this does not preserve the original photo's metadata. This occurs even with the SamplePhotosApp provided by Apple when they apply Sepia or Chrome filters. My question is, how do you ensure all the…

Jordan H
- 52,571
- 37
- 201
- 351
9
votes
1 answer
How to output a CIFilter to a Camera view?
I'm just starting out in Objective-C and I'm trying to create a simple app where it shows the camera view with a blur effect on it. I got the Camera output working with the AVFoundation framework. Now, I'm trying to hook up the Core image framework…

Renz Tan
- 245
- 3
- 10
9
votes
2 answers
CIDetector isn't releasing memory
I'm using CIDetector as follows multiple times:
-(NSArray *)detect:(UIImage *)inimage
{
UIImage *inputimage = inimage;
UIImageOrientation exifOrientation = inimage.imageOrientation;
NSNumber *orientation = [NSNumber…

Avba
- 14,822
- 20
- 92
- 192
8
votes
3 answers
How can you make a CVPixelBuffer directly from a CIImage instead of a UIImage in Swift?
I am recording filtered video through an iPhone camera, and there is a huge increase in CPU usage when converting a CIImage to a UIImage in real time while recording. My buffer function to make a CVPixelBuffer uses a UIImage, which so far requires…

Chewie The Chorkie
- 4,896
- 9
- 46
- 90
8
votes
1 answer
Should I set a color space for a CIImage or a CIContext?
Core Image lets us specify a color space for a CIContext, as in:
let context = CIContext(options: [kCIContextOutputColorSpace: NSNull(),
kCIContextWorkingColorSpace: NSNull()])
Or for a CIImage, as in:
let image =…

Kartick Vaddadi
- 4,818
- 6
- 39
- 55
8
votes
1 answer
PNG/JPEG representation from CIImage always returns nil
I'm currently making a photo editing app.
When a photo is selected by the user, it is automatically converted into black and white using this code:
func blackWhiteImage(image: UIImage) -> Data {
print("Starting black & white")
let orgImg =…

benfernandes
- 179
- 3
- 13
8
votes
4 answers
SceneKit, flip direction of SCNMaterial
extremely new to SceneKit, so just looking for help here:
I have an SCNSphere with a camera at the center of it
I create an SCNMaterial, doubleSided, and assign it to the sphere
Since the camera is at the center, the image looks flipped vertically,…

David Homes
- 2,725
- 8
- 33
- 53