Questions tagged [ciimage]

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.

294 questions
4
votes
1 answer

How do I save a CIImage to Photos with its P3 color space intact?

I'm building a camera app that captures a photo in the BGRA format, and applies a Core Image filter on it before saving it to the Photos app. On the iPhone 7 Plus, the input photo is in the Display P3 color space, but the output is in the sRGB color…
Kartick Vaddadi
  • 4,818
  • 6
  • 39
  • 55
4
votes
0 answers

Swift pixelbuffer cicontext.render has a black background, how to make it transparent?

When I use func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, from connection: AVCaptureConnection!), I need to add a transparent image to the sampleBuffer, but I always get a black background,…
Ping Lin
  • 41
  • 2
4
votes
2 answers

rotate CIImage around center with CIFilter

I'm trying to rotate the pixel data of a CMSampleBuffer (coming from the camera) and display it in a UIImageView. I Don't want to rotate the view itself. It has to be the actual pixel data. I grab the feed, convert it to a CIImage and with a…
Ramin Afshar
  • 989
  • 2
  • 18
  • 34
4
votes
2 answers

CIImage extent in pixels or points?

I'm working with a CIImage, and while I understand it's not a linear image, it does hold some data. My question is whether or not a CIImage's extent property returns pixels or points? According to the documentation, which says very little, it's…
Art C
  • 842
  • 2
  • 10
  • 21
4
votes
0 answers

create local movie out of `CVPixelBufferRef` which gets trimmed at the beginning after some time

I do have lots of CVPixelBufferRef which I would like to append to a movie in "real time", i.e. I get 50 - 60 CVPixelBufferRef per second (as they are frames) and would like to create a local video out of it. Even better would be if I could have…
swalkner
  • 16,679
  • 31
  • 123
  • 210
4
votes
1 answer

Swift playground - cannot convert a filtered UIImage to a CGImage

In a Swift playground, I am loading a JPEG, converting it to a UIImage and filtering it to monochrome. I then convert the resulting filtered image to a UIImage. The input and the filtered images display correctly. I then convert both images to a…
Simon Youens
  • 177
  • 1
  • 13
4
votes
1 answer

Null passed to a callee that requires a non-null argument

I have been using this to convert a CIImage to NSData for ages: NSData *data = [imageRep representationUsingType: NSPNGFileType properties:nil]; Now on El Capitan I have this error on the second line: Null passed to a…
Duck
  • 34,902
  • 47
  • 248
  • 470
4
votes
2 answers

How do I combine two ore more CIImage

How do I combine two or more CIImage into another one. I tried using ciContext.drawImage. How do I get a CGImage from it ?? What I have understood is that I am writing into a context from which I should be able to get an Image. Please let me know if…
Golak Sarangi
  • 809
  • 7
  • 22
4
votes
5 answers

Applying metadata to image causes performChanges request to fail

I am using PhotoKit to edit photos and I need to preserve the metadata from the original photo. To do so I save the metadata then provide it to the options parameter in CGImageDestinationAddImage. I am able to finalize it and write it to disk…
Jordan H
  • 52,571
  • 37
  • 201
  • 351
4
votes
2 answers

How to convert from YUV to CIImage for iOS

I am trying to convert a YUV image to CIIMage and ultimately UIImage. I am fairly novice at these and trying to figure out an easy way to do it. From what I have learnt, from iOS6 YUV can be directly used to create CIImage but as I am trying to…
d1xlord
  • 239
  • 3
  • 4
  • 12
4
votes
2 answers

Adding filters to video with AVFoundation (OSX) - how do I write the resulting image back to AVWriter?

Setting the scene I am working on a video processing app that runs from the command line to read in, process and then export video. I'm working with 4 tracks. Lots of clips that I append into a single track to make one video. Let's call this the…
Tim Bull
  • 2,375
  • 21
  • 25
4
votes
0 answers

Conversion of CIImage to CGImageRef which could be used to create a GLK texture

I have a CIImage which is the result/output image of a CIFilter. Now I want to create a texture of that image using GLKTextureLoader. I am using the following function which requires a CGImageRef to achieve that. [GLKTextureLoader…
Anand
  • 115
  • 1
  • 12
3
votes
1 answer

Specify sampling method in Metal Core Image Kernel

In Metal we can create samplers like this constexpr sampler s(coord::normalized, address::clamp_to_edge, filter::linear); Then we can sample any texture using this sampler. I am wondering if something similar is available in Metal Core Image…
Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131
3
votes
1 answer

How to not cause dark gray color to be transparent removing background from image

I'm having an issue where when I try to remove the green from an image (in this case the image background) but all the dark grays (within the part of the image I want to keep) become semi-transparent. I am unsure why, would like some advice on how…
Joshua Hart
  • 772
  • 1
  • 21
  • 31
3
votes
0 answers

Apply filter to the specific Image Segmentation Matte

I need to get Teeth SegmentationMatte from the image, add some filter to it and save it to the new or to the original image. Here is my current code: func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info:…
Alexey Pelekh
  • 1,143
  • 13
  • 20