---
title: "init(cgImage:scale:orientation:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uiimage/init(cgimage:scale:orientation:)-2ouhh"
---

# init(cgImage:scale:orientation:)

Initializes and returns an image object with the specified scale and orientation factors.

## Declaration

```swift
init(cgImage: CGImage, scale: CGFloat, orientation: UIImage.Orientation)
```

## Parameters

- `cgImage`: The Quartz image object.
- `scale`: The scale factor to assume when interpreting the image data. Applying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the doc://com.apple.uikit/documentation/UIKit/UIImage/size property.
- `orientation`: The orientation of the image data. You can use this parameter to specify any rotation factors applied to the image.

## Return Value

Return Value An initialized UIImage object. In Objective-C, this method returns nil if the ciImage parameter is nil.

## See Also

### Creating and initializing image objects

- [init(contentsOfFile:)](uikit/uiimage/init(contentsoffile:).md)
- [init(data:)](uikit/uiimage/init(data:).md)
- [init(data:scale:)](uikit/uiimage/init(data:scale:).md)
- [init(cgImage:)](uikit/uiimage/init(cgimage:)-14qlb.md)
- [init(ciImage:)](uikit/uiimage/init(ciimage:)-93vu1.md)
- [init(ciImage:scale:orientation:)](uikit/uiimage/init(ciimage:scale:orientation:)-9gpyn.md)
- [UIImageReader](uikit/uiimagereader-swift.struct.md)
