---
title: hasAlpha
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsimagerep/hasalpha
---

# hasAlpha

A Boolean value that indicates whether the image data has an alpha channel.

## Declaration

```swift
var hasAlpha: Bool { get set }
```

## Discussion

Discussion The value of this property is true if the receiver has a known alpha channel; otherwise, false. Subclasses can set this property when loading image data to notify the parent class whether that data contains an alpha component. Specifying a value of true does not add an alpha channel to the image data itself; it merely records the fact that the data has an alpha channel.

## See Also

### Specifying Information About the Representation

- [bitsPerSample](appkit/nsimagerep/bitspersample.md)
- [colorSpaceName](appkit/nsimagerep/colorspacename.md)
- [isOpaque](appkit/nsimagerep/isopaque.md)
- [pixelsHigh](appkit/nsimagerep/pixelshigh.md)
- [pixelsWide](appkit/nsimagerep/pixelswide.md)
- [layoutDirection](appkit/nsimagerep/layoutdirection.md)
- [Device-Specific Value](appkit/device-specific-value.md)
