---
title: "getPixel(_:atX:y:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsbitmapimagerep/getpixel(_:atx:y:)"
---

# getPixel(_:atX:y:)

Returns by indirection the pixel data for the specified location in the bitmap image representation.

## Declaration

```swift
func getPixel(_ p: UnsafeMutablePointer<Int>, atX x: Int, y: Int)
```

## Parameters

- `p`: On return, an array of integers containing raw pixel data in the appropriate order according to the object’s bitmap format. Smaller integer samples, such as 4-bit, are returned as an integer. Floating point values are cast to integer values and returned.
- `x`: The x-axis coordinate of the pixel.
- `y`: The y-axis coordinate of the pixel.

## Discussion

Discussion The origin is in the top-left corner.

## See Also

### Related Documentation

- [bitmapFormat](appkit/nsbitmapimagerep/bitmapformat.md)

### Managing Pixel Values

- [setColor(_:atX:y:)](appkit/nsbitmapimagerep/setcolor(_:atx:y:).md)
- [colorAt(x:y:)](appkit/nsbitmapimagerep/colorat(x:y:).md)
- [setPixel(_:atX:y:)](appkit/nsbitmapimagerep/setpixel(_:atx:y:).md)
