---
title: "vImageErode_ARGB8888(_:_:_:_:_:_:_:_:)"
framework: accelerate
role: symbol
role_heading: Function
path: "accelerate/vimageerode_argb8888(_:_:_:_:_:_:_:_:)"
---

# vImageErode_ARGB8888(_:_:_:_:_:_:_:_:)

Erodes an 8-bit-per-channel, 4-channel interleaved buffer.

## Declaration

```swift
func vImageErode_ARGB8888(_ src: UnsafePointer<vImage_Buffer>, _ dest: UnsafePointer<vImage_Buffer>, _ srcOffsetToROI_X: vImagePixelCount, _ srcOffsetToROI_Y: vImagePixelCount, _ kernel: UnsafePointer<UInt8>, _ kernel_height: vImagePixelCount, _ kernel_width: vImagePixelCount, _ flags: vImage_Flags) -> vImage_Error
```

## Parameters

- `src`: The source vImage buffer.
- `dest`: A pointer to the destination vImage buffer structure. You’re responsible for filling out the doc://com.apple.accelerate/documentation/Accelerate/vImage_Buffer/height, doc://com.apple.accelerate/documentation/Accelerate/vImage_Buffer/width, and doc://com.apple.accelerate/documentation/Accelerate/vImage_Buffer/rowBytes fields of this structure, and for allocating a data buffer of the appropriate size. On return, the data buffer this structure points to contains the destination image data. When you no longer need the data buffer, deallocate the memory to prevent memory leaks.
- `srcOffsetToROI_X`: The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- `srcOffsetToROI_Y`: The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- `kernel`: The kernel data that contains kernel_height * kernel_width elements.
- `kernel_height`: The height of the kernel in pixels. This value needs to be odd.
- `kernel_width`: The width of the kernel in pixels. This value needs to be odd.
- `flags`: The options to use when performing the operation. If your code implements its own tiling or its own multithreading, pass doc://com.apple.accelerate/documentation/Accelerate/kvImageDoNotTile; otherwise, pass doc://com.apple.accelerate/documentation/Accelerate/kvImageNoFlags. To specify that the function doesn’t apply the operation to the alpha channel, set the doc://com.apple.accelerate/documentation/Accelerate/kvImageLeaveAlphaUnchanged flag.

## Return Value

Return Value kvImageNoError; otherwise, one of the error codes in Data Types and Constants.

## Discussion

Discussion Use the erode operation to enlarge dark structural elements in an image. In the case where the kernel contains all zeros, use the corresponding minimize function instead.

## See Also

### Related Documentation

- [Adding a bokeh effect to images](accelerate/adding-a-bokeh-effect-to-images.md)

### Eroding an object

- [vImageErode_Planar8(_:_:_:_:_:_:_:_:)](accelerate/vimageerode_planar8(_:_:_:_:_:_:_:_:).md)
- [vImageErode_PlanarF(_:_:_:_:_:_:_:_:)](accelerate/vimageerode_planarf(_:_:_:_:_:_:_:_:).md)
- [vImageErode_ARGBFFFF(_:_:_:_:_:_:_:_:)](accelerate/vimageerode_argbffff(_:_:_:_:_:_:_:_:).md)
