# toYUV420PixelBuffer Source: https://www.nianticspatial.com/docs/api/swift/NSDK.CGImage.method-toYUV420PixelBuffer/ toYUV420PixelBuffer --- ## Declaration func toYUV420PixelBuffer(width: Int, height: Int) -> CVPixelBuffer? #### Summary Converts the CGImage to a CVPixelBuffer in YUV420NV12 (bi-planar) format for use as a camera feed. Uses Core Image to perform the color conversion. Returns nil if buffer creation or render fails. ### Parameters | Name | Type | Summary | | --- | --- | --- | | width | Int | Target width for the pixel buffer (typically the image width). | | height | Int | Target height for the pixel buffer (typically the image height). | ---