---
title: "init(cgImage:pixelsWide:pixelsHigh:pixelFormatType:options:)"
framework: coreml
role: symbol
role_heading: Initializer
path: "coreml/mlfeaturevalue/init(cgimage:pixelswide:pixelshigh:pixelformattype:options:)-1pdp4"
---

# init(cgImage:pixelsWide:pixelsHigh:pixelFormatType:options:)

Construct image feature value from CGImage (orientation is assumed to be kCGImagePropertyOrientationUp)

## Declaration

```swift
convenience init(cgImage: CGImage, pixelsWide: Int, pixelsHigh: Int, pixelFormatType: OSType, options: [MLFeatureValue.ImageOption : Any]? = nil) throws
```
