The ImagickPixelIterator class allows direct access to the pixels in an image. This allows you to either modify the pixels directly or analyze the pixels directly from PHP.