<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 7.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vImageCGImageFormat_GetComponentCount(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@vImageCGImageFormat_GetComponentCount"
  },
  "title" : "vImageCGImageFormat_GetComponentCount(_:)"
}
-->

# vImageCGImageFormat_GetComponentCount(_:)

Calculates the number of color and alpha channels for a specified image format.

```
func vImageCGImageFormat_GetComponentCount(_ format: UnsafePointer<vImage_CGImageFormat>) -> UInt32
```

## Parameters

`format`

A valid [`vImage_CGImageFormat`](/documentation/Accelerate/vImage_CGImageFormat) structure.

## Return Value

The number of color and alpha channels in the image.

## Discussion

---

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)