Detection of colors and pixel location of an image

hello, I’m looking for an extension or a way to be able to detest the color of a pixel of an image and know the exact location in which it is located, it is necessary to be able to do those two functions to be able to make an AI that recognizes images

Maybe this might help

thanks, but I already saw that post, I can extract the colors but I need to know the position of the pixel from which the color was extracted, that can be done?

Ig you can use canvas if you have to the exact position