<!--
{
  "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:)-5tm47",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate6vImageO11PixelBufferVAaC14InterleavedFx4VRszrlE8multiply2by7preBias04postJ011destinationyqd___Sf_S3ftSf_S3ftAEy_AGGtAA0aD0Rd__Sf7ElementRtd__lF"
  },
  "title" : "multiply(by:preBias:postBias:destination:)"
}
-->

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

Multiplies each four channel pixel in a 32-bit-per channel, 4-channel pixel buffer by a 4 x 4 matrix to produce a four channel result.

```
func multiply<Matrix>(by matrix: Matrix, preBias: (Float, Float, Float, Float), postBias: (Float, Float, Float, Float), destination: vImage.PixelBuffer<vImage.InterleavedFx4>) where Matrix : AccelerateBuffer, Matrix.Element == Float
```

## Parameters

`matrix`

The 4 x 4 multiplication matrix values in row-major order.

`preBias`

Values 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
p = (source.0 + preBias.0) * matrix.0 +
    (source.1 + preBias.1) * matrix.1 +
    (source.2 + preBias.2) * matrix.2 +
    (source.3 + preBias.3) * matrix.3
destination = (p + postBias)
```

---

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)