# Pixel class

Namespace: [Grasshopper2.Imaging.Raycasting](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.imaging.raycasting.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class Pixel
```

A single pixel in a raycasting process.

## Constructors

- [Pixel](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.pixel/ctor.md): Create a new, empty pixel.

## Properties

- [Colour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.pixel/colour.md): Gets the colour implied by all the samples thus far.
- [Completed](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.pixel/completed.md): Bookkeeping property useful for keeping track of pixel 'liveness' over the course of a raysampling process. The pixel itself does not access or read this field.
- [Consistency](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.pixel/consistency.md): Bookkeeping property useful for keeping track of pixel consistency over the course of a raysampling process. The pixel itself does not access or read this field.
- [N](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.pixel/n.md): Gets the number of samples made through this pixel.
- [X](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.pixel/x.md): Gets the pixel X coordinate.
- [Y](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.pixel/y.md): Gets the pixel Y coordinate.

## Methods

- [AddSample](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.pixel/addsample.md): (2 overloads) Add a new sample to this pixel. This method is threadsafe.
- [NextRay](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.pixel/nextray.md): Gets the next ray position based on the pixel [x,y] coordinates and the sampling density. This method is threadsafe.
- [SetColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.pixel/setcolour.md): Set the colour of this pixel and revert the N counter.
