Questions tagged [getpixel]

GetPixel is a Windows GDI API function which retrieves the RGB color value of the pixel at a specific coordinates.

199 questions
0
votes
0 answers

get color by touch camera live

I did create camera live now I want now the value of color (r, g, b) after get the touched pixel (x, y) I have my attempt but it show always R(0)G(0)B(0) I want know what is the problem... that is my code I used java in android studio and open…
tlmary
  • 1
  • 1
0
votes
1 answer

Python script using ImageGrab causes intermittent stuttering

Code here: def getColor(): return ImageGrab.grab().getpixel(position) #was mouse.position def crash_detect(): global running, crashed if isOnL(getColor()): printColor("(" + str(datetime.now().strftime("%H:%M")) + ")" +…
GoTVm
  • 31
  • 6
0
votes
1 answer

ctypes gdi32.GetPixel() returning inaccurate values - python

I am trying to grab the color of a pixel on screen. GetPixel() is giving me something close to the actual color, but different every time. I've tried setting the dpi awareness but that has not solved the issue. This is my current code: import…
0
votes
0 answers

Why does pyautogui get pixel returns 4 items

I tried to use pyautogui to get a rgb of a pixel of a screen shot. And instead of returning an rgb, it returns 4 items. How do I fix this? Here is my code: import pyautogui im1 =…
user18970005
0
votes
0 answers

How can I make GetPixel function work on google chrome?

I'm sorry if a similar post exists but I couldn't find it. I have been learning to use the windows.h library for 2 days. I have problems with the GetPixel function returns 0 on google chrome but returns the good values on applications installed on…
PsyKozZ09
  • 21
  • 3
0
votes
0 answers

GetPixel with cursor from real time video

I am working on image processing project. I convert real time video to black and white with Canny Edge Detection. I need pixel number (x,y) of edges which is defined with Cursor. I plan to use GetPixel and Cursor but my question is if i pick the…
0
votes
0 answers

vb.net scan screen with multiple instances

I have an app scanning a window area with this method inside a loop: GDI32.GetPixel(ntPtr hdc, int nXPos, int nYPos) This is working properly although in some computers it takes quite a lot of resources. Now I will have different instances running,…
K. Weber
  • 2,643
  • 5
  • 45
  • 77
0
votes
2 answers

OpenCV get pixels on an ellipse

I'm trying to get the pixels of an ellipse from an image. For example, I draw an ellipse on a random image (sample geeksforgeeks code): import cv2 path = r'C:\Users\Rajnish\Desktop\geeksforgeeks\geeks.png' image = cv2.imread(path) window_name =…
ArenMayank
  • 17
  • 4
0
votes
0 answers

Weird interaction of getPixel() (async issue maybe?)

I am making a class to read a chess board from the screen. In my function to check if a square is empty I use the GetPixel().GetBrightness() to check if the square contains a piece. GetPixel() seems to hang when I debug. (it never reaches the next…
Stef
  • 11
0
votes
0 answers

why win32gui's getpixel() is lot slower in windows 10 compared to windows 7 ? is there any solution?

I know that using win32gui is the fastest way to get the pixel data compared to PIL and other such libraries. Up until now I was executing my code in windows 7 laptop(old) where it was working very fast but recently I bought a new laptop(processor…
0
votes
2 answers

How to quickly scan and analyze large groups of pixels?

I am trying to build an autoclicker using C++ to beat a 2D videogame in which the following situation appears: The main character is in the center of the screen, the background is completely black and enemies are coming from all directions. I want…
Saul Martinez
  • 114
  • 11
0
votes
1 answer

Python getpixel then click on described color in RGB

I've found this code at stackoverflow color = (0, 137, 241) s = pyautogui.screenshot() for x in range(s.width): for y in range(s.height): if s.getpixel((x, y)) == color: pyautogui.click(x, y) # do something here …
0
votes
0 answers

Getting a pixel color in fullscreen games using Python

Im a Python beginner trying to get the most dominant color (using the ColorTheif module) from a fullscreen game and outputting the RGB values to a text file. Here is what I've got so far: (not written by me) import pyscreenshot as ImageGrab #…
0
votes
0 answers

color values different per monitor with getpixel/lockbits

Im trying to make a method that returns the color value of a specific pixel. The problem i am having it that the same piece of code returns a different ARGB on different monitors. Currently im using this method: public static Color…
Neoray
  • 71
  • 1
  • 6
0
votes
1 answer

Manipulating Image Data (eg GetPixel, SetPixel. ScaleX)

I am trying to create an application that takes plain text from a file, creates a formatted raster image of it and then flips it left to right for reading in a mirror. This is an auto-cue, tele-prompter application. I can create the image with…
SolwiseMD
  • 69
  • 5