<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIImage/orientationTransform(forExifOrientation:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIImage(im)imageTransformForOrientation:"
  },
  "title" : "orientationTransform(forExifOrientation:)"
}
-->

# orientationTransform(forExifOrientation:)

Returns the transformation needed to reorient the image to the specified orientation.

```
func orientationTransform(forExifOrientation orientation: Int32) -> CGAffineTransform
```

## Parameters

`orientation`

An integer specifying an image orientation according to the EXIF specification. For details, see <doc://com.apple.documentation/documentation/ImageIO/kCGImagePropertyOrientation>.

## Return Value

An affine transform that will rotate or mirror the image to match the specified orientation when applied.

## Discussion

This method determines the transformation needed to match the specified orientation, but does not apply that transformation to the image. To apply the transformation (possibly after concatenating it with other transformations), use the [`transformed(by:)`](/documentation/CoreImage/CIImage/transformed(by:)) method or the `CIAffineTransform` filter. To determine and apply the transformation in a single step, use the [`oriented(forExifOrientation:)`](/documentation/CoreImage/CIImage/oriented(forExifOrientation:)) method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)