Is there a way to get color of pixel at specific x/y?

On sprite object. I am in the process of porting my 2D procedural world generator and the way it works is first generate image of the level (every level tile is one pixel) and then interpreting every pixel as tile type (every tile type has assigned r,g,b values). This also makes easy to do predefined levels if I skip generation step and just draw level in Paint or something and then load.

The problem is how do I get color of the pixel at specific x/y. I’d like something like this implemented if it isn’t already.

Something similar was recently asked: viewtopic.php?f=19&t=4962&p=41571&hilit=how+to+get+pixel#p41571

The answer seems to be no.