---
title: "init(imageAtURL:pixelsWide:pixelsHigh:pixelFormatType:options:)"
framework: coreml
role: symbol
role_heading: Initializer
path: "coreml/mlfeaturevalue/init(imageaturl:pixelswide:pixelshigh:pixelformattype:options:)"
---

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

Creates a feature value that contains an image defined by an image URL and the image’s size and pixel format.

## Declaration

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

## Parameters

- `url`: A doc://com.apple.documentation/documentation/Foundation/URL (Swift) or doc://com.apple.documentation/documentation/Foundation/NSURL (Objective-C) to an image.
- `pixelsWide`: The image’s width in pixels.
- `pixelsHigh`: The image’s height in pixels.
- `pixelFormatType`: The image’s pixel format (see doc://com.apple.documentation/documentation/CoreVideo/pixel-format-identifiers).
- `options`: A dictionary of doc://com.apple.documentation/documentation/Vision/VNImageCropAndScaleOption values, each keyed by doc://com.apple.coreml/documentation/CoreML/MLFeatureValue/ImageOption.

## See Also

### Creating image feature values

- [init(pixelBuffer:)](coreml/mlfeaturevalue/init(pixelbuffer:).md)
- [init(CGImage:pixelsWide:pixelsHigh:pixelFormatType:options:)](coreml/mlfeaturevalue/init(cgimage:pixelswide:pixelshigh:pixelformattype:options:)-2zg43.md)
- [init(CGImage:orientation:pixelsWide:pixelsHigh:pixelFormatType:options:)](coreml/mlfeaturevalue/init(cgimage:orientation:pixelswide:pixelshigh:pixelformattype:options:)-4nme0.md)
- [init(CGImage:constraint:options:)](coreml/mlfeaturevalue/init(cgimage:constraint:options:)-1j00l.md)
- [init(CGImage:orientation:constraint:options:)](coreml/mlfeaturevalue/init(cgimage:orientation:constraint:options:)-87vk0.md)
- [init(imageAtURL:orientation:pixelsWide:pixelsHigh:pixelFormatType:options:)](coreml/mlfeaturevalue/init(imageaturl:orientation:pixelswide:pixelshigh:pixelformattype:options:).md)
- [init(imageAtURL:constraint:options:)](coreml/mlfeaturevalue/init(imageaturl:constraint:options:).md)
- [init(imageAtURL:orientation:constraint:options:)](coreml/mlfeaturevalue/init(imageaturl:orientation:constraint:options:).md)
- [MLImageConstraint](coreml/mlimageconstraint.md)
- [MLFeatureValue.ImageOption](coreml/mlfeaturevalue/imageoption.md)
