Hi all,
I was recently having a look at the pywin32 module and found a multitude of approaches on how to find the color of a pixel given its coordinates, but was wondering if there was a way to find the coordinate of a pixel given its particular color, either as an rgb tuple or hex vlaue.
any help is greatly appreciated

Recommended Answers

All 5 Replies

What relation could there possibly exist between coordinates and RGB values?
Unless, you have another definition of coordinates than me.

What I meant is how would one generate a list of coordinates of pixels of a particular color. The end effect I'm trying to achieve is to have the program be able to find the location of a particular color on screen, and then clicking on it. The clicking etc I understand how to do, yet the only method I know of finding the location of a colour would be to take a screenshot of the pixel at (0,0), check if it's colour matches the one I have predetermined, and then iterate across and down the screen with a loop function or something, which is massively slow.
Thanks for your help:)

cheers for all the helps guys, got it working by using PIL, it now takes a screenshot and checks for pixels in a color range, saving the coordinates and then clicking on them later:) thanks again for your assisstance!

Im also working a project that requires finding the coordinates of a certain color on the screen and am stuck on the same part as you it would be helpful if you could let me know how you did this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.