---
title: "init(cgImage:constraint:options:)"
framework: coreml
role: symbol
role_heading: Initializer
path: "coreml/mlfeaturevalue/init(cgimage:constraint:options:)-30mu4"
---

# init(cgImage:constraint:options:)

Construct image feature value from CGImage, using the size and type information required by feature description (orientation is assumed to be kCGImagePropertyOrientationUp)

## Declaration

```swift
convenience init(cgImage: CGImage, constraint: MLImageConstraint, options: [MLFeatureValue.ImageOption : Any]? = nil) throws
```
