<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/applying-geometric-operations-to-pixel-buffers",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Applying geometric operations to pixel buffers"
}
-->

# Applying geometric operations to pixel buffers

Reflect, shear, rotate, scale, and apply affine transforms to image data.

## Topics

### Reflecting images

[`func reflect(over: vImage.ReflectionAxis, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/reflect(over:destination:)-9ezqm)

Reflects an 8-bit planar pixel buffer over a horizontal or vertical axis.

[`func reflect(over: vImage.ReflectionAxis, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/reflect(over:destination:)-529j0)

Reflects a floating-point 16-bit planar pixel buffer over a horizontal or vertical axis.

[`func reflect(over: vImage.ReflectionAxis, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/reflect(over:destination:)-4i4vi)

Reflects a 32-bit planar pixel buffer over a horizontal or vertical axis.

[`func reflect(over: vImage.ReflectionAxis, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/reflect(over:destination:)-6syq1)

Reflects a floating-point 16-bit-per-channel, two-channel interleaved pixel buffer over a horizontal or vertical axis.

[`func reflect(over: vImage.ReflectionAxis, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/reflect(over:destination:)-7o9tt)

Reflects an 8-bit-per-channel, four-channel interleaved pixel buffer over a horizontal or vertical axis.

[`func reflect(over: vImage.ReflectionAxis, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/reflect(over:destination:)-fg4a)

Reflects an unsigned 16-bit-per-channel, four-channel interleaved pixel buffer over a horizontal or vertical axis.

[`func reflect(over: vImage.ReflectionAxis, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/reflect(over:destination:)-97wi9)

Reflects a floating-point 16-bit-per-channel, four-channel interleaved pixel buffer over a horizontal or vertical axis.

[`func reflect(over: vImage.ReflectionAxis, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/reflect(over:destination:)-7b1md)

Reflects a 32-bit-per-channel, four-channel interleaved pixel buffer over a horizontal or vertical axis.

[`enum ReflectionAxis`](/documentation/Accelerate/vImage/ReflectionAxis)

The axis to reflect an image.

### Rotating images

[`func rotate(vImage.Rotation, backgroundColor: Pixel_8?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/rotate(_:backgroundColor:destination:)-7patt)

Rotates an 8-bit planar pixel buffer.

[`func rotate(vImage.Rotation, backgroundColor: Pixel_16F?, useFloat16Accumulator: Bool, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/rotate(_:backgroundColor:useFloat16Accumulator:destination:)-9harr)

Rotates a floating-point 16-bit planar pixel buffer.

[`func rotate(vImage.Rotation, backgroundColor: Pixel_F?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/rotate(_:backgroundColor:destination:)-7tzsn)

Rotates a 32-bit planar pixel buffer.

[`func rotate(vImage.Rotation, backgroundColor: Pixel_16F16F?, useFloat16Accumulator: Bool, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/rotate(_:backgroundColor:useFloat16Accumulator:destination:)-61l7b)

Rotates a floating-point 16-bit-per-channel, two-channel interleaved pixel buffer.

[`func rotate(vImage.Rotation, backgroundColor: Pixel_8888?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/rotate(_:backgroundColor:destination:)-2li9v)

Rotates an 8-bit-per-channel, four-channel interleaved pixel buffer.

[`func rotate(vImage.Rotation, backgroundColor: Pixel_ARGB_16U?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/rotate(_:backgroundColor:destination:)-692ke)

Rotates an unsigned 16-bit-per-channel, four-channel interleaved pixel buffer.

[`func rotate(vImage.Rotation, backgroundColor: Pixel_ARGB_16F?, useFloat16Accumulator: Bool, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/rotate(_:backgroundColor:useFloat16Accumulator:destination:)-8glur)

Rotates a floating-point 16-bit-per-channel, four-channel interleaved pixel buffer.

[`func rotate(vImage.Rotation, backgroundColor: Pixel_FFFF?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/rotate(_:backgroundColor:destination:)-9bnb6)

Rotates a 32-bit-per-channel, four-channel interleaved pixel buffer.

[`enum Rotation`](/documentation/Accelerate/vImage/Rotation)

The angle to rotate an image.

### Scaling images

[`func scale(destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/scale(destination:)-5euvc)

Scales an 8-bit planar pixel buffer to fit the destination buffer.

[`func scale(destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/scale(destination:)-9si6m)

Scales an unsigned 16-bit planar pixel buffer to fit the destination buffer.

[`func scale(useFloat16Accumulator: Bool, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/scale(useFloat16Accumulator:destination:)-5lt9n)

Scales a floating-point 16-bit planar pixel buffer to fit the destination buffer.

[`func scale(destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/scale(destination:)-6xwro)

Scales a 32-bit planar pixel buffer to fit the destination buffer.

[`func scale(destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/scale(destination:)-6gy9p)

Scales an 8-bit-per-channel, two-channel interleaved pixel buffer to fit the destination buffer.

[`func scale(destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/scale(destination:)-4p5r6)

Scales an unsigned 16-bit-per-channel, two-channel interleaved pixel buffer to fit the destination buffer.

[`func scale(useFloat16Accumulator: Bool, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/scale(useFloat16Accumulator:destination:)-thg7)

Scales a floating-point 16-bit-per-channel, two-channel interleaved pixel buffer to fit the destination buffer.

[`func scale(destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/scale(destination:)-y1zi)

Scales an 8-bit-per-channel, four-channel interleaved pixel buffer to fit the destination buffer.

[`func scale(destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/scale(destination:)-5tpok)

Scales an unsigned 16-bit-per-channel, four-channel interleaved pixel buffer to fit the destination buffer.

[`func scale(useFloat16Accumulator: Bool, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/scale(useFloat16Accumulator:destination:)-st2u)

Scales a floating-point 16-bit-per-channel, four-channel interleaved pixel buffer to fit the destination buffer.

[`func scale(destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/scale(destination:)-2hqm3)

Scales a 32-bit-per-channel, four-channel interleaved pixel buffer to fit the destination buffer.

### Shearing images

[`func shear<T>(direction: vImage.ShearDirection, translate: T, slope: T, resamplingFilter: ResamplingFilter, backgroundColor: Pixel_8?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/shear(direction:translate:slope:resamplingFilter:backgroundColor:destination:)-2gf4y)

Performs a horizontal or vertical shear operation on an 8-bit planar pixel buffer.

[`func shear(direction: vImage.ShearDirection, translate: Float, slope: Float, resamplingFilter: ResamplingFilter, backgroundColor: Pixel_16U?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/shear(direction:translate:slope:resamplingFilter:backgroundColor:destination:)-5busu)

Performs a horizontal or vertical shear operation on an unsigned 16-bit planar pixel buffer.

[`func shear<T>(direction: vImage.ShearDirection, translate: T, slope: T, resamplingFilter: ResamplingFilter, backgroundColor: Pixel_16F?, useFloat16Accumulator: Bool, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/shear(direction:translate:slope:resamplingFilter:backgroundColor:useFloat16Accumulator:destination:)-26sh4)

Performs a horizontal or vertical shear operation on a floating-point 16-bit planar pixel buffer.

[`func shear<T>(direction: vImage.ShearDirection, translate: T, slope: T, resamplingFilter: ResamplingFilter, backgroundColor: Pixel_F?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/shear(direction:translate:slope:resamplingFilter:backgroundColor:destination:)-85o1n)

Performs a horizontal or vertical shear operation on a 32-bit planar pixel buffer.

[`func shear<T>(direction: vImage.ShearDirection, translate: T, slope: T, resamplingFilter: ResamplingFilter, backgroundColor: Pixel_16U16U?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/shear(direction:translate:slope:resamplingFilter:backgroundColor:destination:)-57dzf)

Performs a horizontal or vertical shear operation on an unsigned 16-bit-per-channel, two-channel interleaved pixel buffer.

[`func shear(direction: vImage.ShearDirection, translate: Float, slope: Float, resamplingFilter: ResamplingFilter, backgroundColor: Pixel_88?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/shear(direction:translate:slope:resamplingFilter:backgroundColor:destination:)-7fou8)

Performs a horizontal or vertical shear operation on an 8-bit-per-channel, two-channel interleaved pixel buffer.

[`func shear<T>(direction: vImage.ShearDirection, translate: T, slope: T, resamplingFilter: ResamplingFilter, backgroundColor: Pixel_16F16F?, useFloat16Accumulator: Bool, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/shear(direction:translate:slope:resamplingFilter:backgroundColor:useFloat16Accumulator:destination:)-7nh4n)

Performs a horizontal or vertical shear operation on a floating-point 16-bit-per-channel, two-channel interleaved pixel buffer.

[`func shear<T>(direction: vImage.ShearDirection, translate: T, slope: T, resamplingFilter: ResamplingFilter, backgroundColor: Pixel_8888?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/shear(direction:translate:slope:resamplingFilter:backgroundColor:destination:)-95446)

Performs a horizontal or vertical shear operation on an 8-bit-per-channel, four-channel interleaved pixel buffer.

[`func shear<T>(direction: vImage.ShearDirection, translate: T, slope: T, resamplingFilter: ResamplingFilter, backgroundColor: Pixel_ARGB_16U?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/shear(direction:translate:slope:resamplingFilter:backgroundColor:destination:)-2ezuh)

Performs a horizontal or vertical shear operation on an unsigned 16-bit-per-channel, four-channel interleaved pixel buffer.

[`func shear<T>(direction: vImage.ShearDirection, translate: T, slope: T, resamplingFilter: ResamplingFilter, backgroundColor: Pixel_ARGB_16F?, useFloat16Accumulator: Bool, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/shear(direction:translate:slope:resamplingFilter:backgroundColor:useFloat16Accumulator:destination:)-7kddt)

Performs a horizontal or vertical shear operation on a floating-point 16-bit-per-channel, four-channel interleaved pixel buffer.

[`func shear<T>(direction: vImage.ShearDirection, translate: T, slope: T, resamplingFilter: ResamplingFilter, backgroundColor: Pixel_FFFF?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/shear(direction:translate:slope:resamplingFilter:backgroundColor:destination:)-7r29q)

Performs a horizontal or vertical shear operation on a 32-bit-per-channel, four-channel interleaved pixel buffer.

[`enum ShearDirection`](/documentation/Accelerate/vImage/ShearDirection)

The shear direction.

### Applying affine transformations to images

[`func transform(CGAffineTransform, backgroundColor: Pixel_8?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/transform(_:backgroundColor:destination:)-4wy4q)

Applies a Core Graphics affine transformation to an 8-bit planar pixel buffer.

[`func transform(CGAffineTransform, backgroundColor: Pixel_16F?, useFloat16Accumulator: Bool, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/transform(_:backgroundColor:useFloat16Accumulator:destination:)-1470p)

Applies a Core Graphics affine transformation to a floating-point 16-bit planar pixel buffer.

[`func transform(CGAffineTransform, backgroundColor: Pixel_F?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/transform(_:backgroundColor:destination:)-1s38)

Applies a Core Graphics affine transformation to a floating-point 32-bit planar pixel buffer.

[`func transform(CGAffineTransform, backgroundColor: Pixel_16F16F?, useFloat16Accumulator: Bool, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/transform(_:backgroundColor:useFloat16Accumulator:destination:)-4w4jr)

Applies a Core Graphics affine transformation to a floating-point 16-bit-per-channel, two-channel interleaved pixel buffer.

[`func transform(CGAffineTransform, backgroundColor: Pixel_8888?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/transform(_:backgroundColor:destination:)-5kxj6)

Applies a Core Graphics affine transformation to an 8-bit-per-channel, four-channel interleaved pixel buffer.

[`func transform(CGAffineTransform, backgroundColor: Pixel_ARGB_16U?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/transform(_:backgroundColor:destination:)-nl6g)

Applies a Core Graphics affine transformation to an unsigned 16-bit-per-channel, four-channel interleaved pixel buffer.

[`func transform(CGAffineTransform, backgroundColor: Pixel_ARGB_16F?, useFloat16Accumulator: Bool, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/transform(_:backgroundColor:useFloat16Accumulator:destination:)-1lvaa)

Applies a Core Graphics affine transformation to a floating-point 16-bit-per-channel, four-channel interleaved pixel buffer.

[`func transform(CGAffineTransform, backgroundColor: Pixel_FFFF?, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/transform(_:backgroundColor:destination:)-9ggt)

Applies a Core Graphics affine transformation to a floating-point 32-bit-per-channel, four-channel interleaved pixel buffer.

### Applying projective transformations to images

[`func transform(vImage_PerpsectiveTransform, interpolation: vImage_PerpsectiveTransform.Interpolation, backgroundColor: Pixel_8, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/transform(_:interpolation:backgroundColor:destination:)-94t75)

Applies a perspective warp to an 8-bit planar image.

[`func transform(vImage_PerpsectiveTransform, interpolation: vImage_PerpsectiveTransform.Interpolation, backgroundColor: Pixel_8888, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/transform(_:interpolation:backgroundColor:destination:)-902c9)

Applies a perspective warp to an interleaved 4-channel, 8-bit planar image.

[`func transform(vImage_PerpsectiveTransform, interpolation: vImage_PerpsectiveTransform.Interpolation, backgroundColor: Pixel_16U, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/transform(_:interpolation:backgroundColor:destination:)-9pv8u)

Applies a perspective warp to an unsigned-integer 16-bit planar image.

[`func transform(vImage_PerpsectiveTransform, interpolation: vImage_PerpsectiveTransform.Interpolation, backgroundColor: Pixel_ARGB_16U, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/transform(_:interpolation:backgroundColor:destination:)-4wvdj)

Applies a perspective warp to an interleaved 4-channel, unsigned 16-bit planar image.

[`func transform(vImage_PerpsectiveTransform, interpolation: vImage_PerpsectiveTransform.Interpolation, backgroundColor: Pixel_16F, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/transform(_:interpolation:backgroundColor:destination:)-79mov)

Applies a perspective warp to a floating-point 16-bit planar image.

[`func transform(vImage_PerpsectiveTransform, interpolation: vImage_PerpsectiveTransform.Interpolation, backgroundColor: Pixel_ARGB_16F, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/transform(_:interpolation:backgroundColor:destination:)-7qnl8)

Applies a perspective warp to an interleaved 4-channel, floating-point 16-bit planar image.



---

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)