<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vImage/PixelBuffer/multiply(by:preBias:postBias:destination:)-3bh2a",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate6vImageO11PixelBufferVAaC7PlanarFVRszrlE8multiply2by7preBias04postI011destinationySf_S2fAEy_AGGtF"
  },
  "title" : "multiply(by:preBias:postBias:destination:)"
}
-->

# multiply(by:preBias:postBias:destination:)

Multiplies each pixel in a 32-bit planar pixel buffer by the specified factor.

```
func multiply(by factor: Float, preBias: Float, postBias: Float, destination: vImage.PixelBuffer<vImage.PlanarF>)
```

## Parameters

`factor`

The multiplication factor.

`preBias`

A value that the function adds to the source before multiplication.

`postBias`

A value that the function adds to the result after multiplication.

`destination`

The destination pixel buffer.

## Discussion

This function applies the following operation to each pixel:

```swift
destination = ((source + preBias) * factor) + postBias
```

For example, the following code multiplies each pixel value in a 32-bit planar buffer by `2`:

```swift
   let buffer = vImage.PixelBuffer<vImage.PlanarF>(
       pixelValues: [0.1, 0.2, 0.3, 0.4, 0.5],
       size: vImage.Size(width: 5,
                         height: 1))

   buffer.multiply(by: 2,
                   preBias: 0, postBias: 0,
                   destination: buffer)

   // Prints "[0.2, 0.4, 0.6, 0.8, 1.0]"
   print(buffer.array)
```

---

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)