I saw ( can't remember where) a little c utility that did precisely that. You might google for it. It did a global_grab of the desktop, and made the mouse an eye-drop icon, then let you click on a pixel. For code, look at any screen capture program, and figure out the mouse bindings needed to get pixel value at that position. The screen capture is already capturing all pixels, so printing them out shouldn't be too hard. GD, Imager and ImageMagick all have some mechanism to dump ALL pixels, or pixels at a known point.