vImage is a library of high-performance image-processing routines provided by Apple in macOS, iOS, tvOS, and watchOS. It includes functions for image manipulation—convolutions, geometric transformations, histogram operations, morphological transformations, and alpha compositing—as well as utility functions for format conversions and other operations.
Questions tagged [vimage]
62 questions
2
votes
0 answers
vImage_Buffer init with pixel buffer
I am using the following code to initialize a vImage_Buffer from a pixel buffer. I have passed the second argument in vImageBuffer_InitWithCVPixelBuffer as NULL (vImage_CGImageFormat) so that there are no internal format conversions from pixel…

Deepak Sharma
- 5,577
- 7
- 55
- 131
2
votes
4 answers
Does anyone have example code for vImage processing on iOS?
I have read through every bit of documentation out there that I can find, but cannot get a simple vImage call to work. I just need a real example. Documentation is very sparse.

akaru
- 6,299
- 9
- 63
- 102
2
votes
0 answers
Which algorithm is used by os x yosemite in SIPS -z to resize image?
I am trying to find out which algorithm is used to resize image when I called sips -z function from the terminal mac os x yosemite.
It seems Lanczos algorithm used in vImage framework. And it is claimed as "vImage’s geometry transforms usually look…

user2616232
- 661
- 1
- 9
- 14
2
votes
1 answer
For IOS, how to use vImage to convert an ARGB image to Gray image
I am a freshman for IOS APP development, and I met a problem: " how to use vImage to convert an ARGB image to Gray image ". Actually, I have realized this conversion processing by other methods. However, I have found "vImage" could complete this…

Rucy Cheng
- 21
- 2
2
votes
1 answer
How do you get Unmanaged from CGColorSpace?
I am writing a function in Swift that creates a vImage_CGImageFormat from a CGImage as follows:
vImage_CGImageFormat(
bitsPerComponent: UInt32(CGImageGetBitsPerComponent(image)),
bitsPerPixel: UInt32(CGImageGetBitsPerPixel(image)),
…

fyell
- 221
- 1
- 7
2
votes
3 answers
"fatal error: unexpectedly found nil while unwrapping an Optional value" while using vImageBuffer_initWithCGImage in Swift ios
I'm working in Swift iOS8 and trying to convert UIImage to vImage_Buffer to perform manipulations using Accelerate.framework. I'm trying to use vImageBuffer_initWithCGImage for conversion, here is the code that I tried:
func…

JeniaM
- 21
- 5
2
votes
3 answers
vImageConvert to extract one channel
How can i "extract" only one channel from an image using vImage?
My approach right now is:
vImage_Buffer redBuffer;
redBuffer.data = (void*)redImageData.bytes;
redBuffer.width = size.width;
redBuffer.height = size.height;
redBuffer.rowBytes =…

thomasguenzel
- 670
- 7
- 25
2
votes
4 answers
iOS Cocoa Touch vImage Subsampling
I am working with vImages in Cocoa Touch, which in my case are basically ARGB-float-Arrays, and I need to do a subsampling. Low pass filtering is no problem using the vImage functions but how do I select one out 2x2 pixels (assuming I want to…

Chris
- 637
- 9
- 20
2
votes
3 answers
how to scale gray scale image using accelerate framework (vImage)
Hi i need to scale a gray scale image fast, so i tried vImage and the app is crashing, please help. In the below code srcimg.data/dstimg.data is a point to unsigned char image data(single channel only gray data).
vImage_Buffer…

pradeepa
- 4,104
- 5
- 31
- 41
1
vote
1 answer
Array of pixel values for vImage PixelBuffer produces black bar in image
In the code shown below, I'm generating an array of RGB pixel values for the vImage.PixelBuffer and creating an image from that buffer. But the generated image contains a black bar. Any ideas on what is causing the black bar?
import Accelerate
let…

wigging
- 8,492
- 12
- 75
- 117
1
vote
1 answer
How do I use vImage_Buffer to manage pixels and create an image?
I want to define an image as RGB(A) values in an array, then I want to use vImage_buffer to produce ultimately produce a CG/UI image.
There's a Pixel_8888 data type (an alias for (UInt8, UInt8, UInt8, UInt8)) that seems like a promising data type to…

Scott McKenzie
- 16,052
- 8
- 45
- 70
1
vote
1 answer
Using vImage_Scale with kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
I am receiving a CMSampleBuffer from the front camera of my iPhone. Currently its size is 1920x1080, and I want to scale it down to 1280x720. I want to use the vImageScale function but I can't get it working correctly. The pixel format from the…

Tometoyou
- 7,792
- 12
- 62
- 108
1
vote
1 answer
I can't get vImage (Accelerate Framework) to convert 420Yp8_Cb8_Cr8 (planar) to ARGB8888
I'm trying to convert Planar YpCbCr to RGBA and it's failing with error kvImageRoiLargerThanInputBuffer.
I tried two different ways. Here're some code snippets.
Note 'thumbnail_buffers + 1' and 'thumbnail_buffers + 2' have width and height half of…

Mustang
- 363
- 2
- 9
1
vote
1 answer
Fast UInt to Float conversion in Swift
I am doing some realtime image analysis on a live videostream. I am using vImage to calculate histograms and vDSP for some further processing. I have Objective-C code that has been working well over the years. I am now about to convert it to Swift.…

Sten
- 3,624
- 1
- 27
- 26
1
vote
1 answer
Scale vImage_Buffer with offset - Cocoa Objective C
I am trying to scale an image using vImage_Buffer and the below code works for me. My trouble is I want to maintain the aspect ratio of the source image, so I might need to add a xOffset or yOffset. Below code only works for yOffset. How can I scale…

prabhu
- 1,158
- 1
- 12
- 27