---
title: "applyGamma(_:destination:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/vimage/pixelbuffer/applygamma(_:destination:)"
---

# applyGamma(_:destination:)

Applies a gamma function to a 32-bit pixel buffer.

## Declaration

```swift
func applyGamma(_ gamma: vImage.Gamma, destination: vImage.PixelBuffer<Format>)
```

## Parameters

- `gamma`: An enumeration that specifies either a used-defined or constant gamma.
- `destination`: The destination pixel buffer.

## Discussion

Discussion For example, the following code applies a gamma of `2.0` to a one-pixel pixel buffer: let buffer = vImage.PixelBuffer<vImage.PlanarF>(     pixelValues: [0.5],     size: vImage.Size(width: 1,                       height: 1))

buffer.applyGamma(.fullPrecision(2),                   destination: buffer)

// Prints "[0.25]" = [0.5²]. print(buffer.array)

## See Also

### Applying gamma

- [applyGamma(_:intermediateBuffer:destination:)](accelerate/vimage/pixelbuffer/applygamma(_:intermediatebuffer:destination:)-1fif9.md)
- [applyGamma(_:intermediateBuffer:destination:)](accelerate/vimage/pixelbuffer/applygamma(_:intermediatebuffer:destination:)-390k5.md)
- [applyGamma(_:intermediateBuffer:destination:)](accelerate/vimage/pixelbuffer/applygamma(_:intermediatebuffer:destination:)-3yu0w.md)
- [applyGamma(_:intermediateBuffer:destination:)](accelerate/vimage/pixelbuffer/applygamma(_:intermediatebuffer:destination:)-wsww.md)
- [vImage.Gamma](accelerate/vimage/gamma.md)
