---
title: "applyMorphology(operation:destination:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/vimage/pixelbuffer/applymorphology(operation:destination:)-5al25"
---

# applyMorphology(operation:destination:)

Applies a morphology operation to the buffer.

## Declaration

```swift
func applyMorphology(operation: vImage.MorphologyOperation<Format.ComponentType>, destination: vImage.PixelBuffer<Format>)
```

## Parameters

- `operation`: The operation that the function applies.
- `destination`: The destination pixel buffer.

## Discussion

Discussion note: Source and destination buffer must be the same size. note: The kernel size width and height must be positive, odd integers in the range note: dilate and erode user defined kernels must contain width * height elements. note: Source and destination buffers must point to different underlying memory.
