GetPixel is a Windows GDI API function which retrieves the RGB color value of the pixel at a specific coordinates.
Questions tagged [getpixel]
199 questions
2
votes
1 answer
Bitmap is returning strange Color values
I am trying to transfer a standard .jpeg image into an array of Color values which are stored as int values by the Bitmap's getPixels method. My code will load in the image and send its data to a one dimensional int array, but some of the values do…

StenBone
- 87
- 8
2
votes
3 answers
Android Bitmap.getPixel always returns negative
I am a newbie using Android and have been really working on this problem for four days now. I would really appreciate someone's help.
I have an image in an ImageView, and I would like to get the color of the part of the image that the user touches.…

patriciasc
- 133
- 1
- 7
2
votes
2 answers
Comparing two images for motion detecting purposes
I've started differentiating two images by counting the number of different pixels using a simple algorithm:
private int returnCountOfDifferentPixels(String pic1, String pic2)
{
Bitmap i1 = loadBitmap(pic1);
Bitmap i2 =…

Emil Anca
- 153
- 1
- 10
1
vote
1 answer
scanning pixels of .tiff image using imageJ library
im using the imageJ library to read a .tiff image file. But when im trying to read the pixels of image1 in variable c, i get an error saying "incompatible types: required int, found int[].
im quiet new to java, so can somebody tell me how to get…

me erum
- 33
- 1
- 2
- 6
1
vote
3 answers
Decoding a .bmp file to binary
I am trying to write a C# program designed to convert a .bmp file into binary.
The file is 16x16 pixels. Each black pixel represents a one in binary, so the number 10 would be █[]█[][][][][]
The problem I am having is that my code is not recognizing…

Krikler7
- 13
- 4
1
vote
1 answer
How to get the colored pixels on a bitmap loaded by a hdc?
I followed a tutorial to get a window on a HDC. I converted it to a bitmap to search a specific pixel. Normally this is faster than searching directly on a hdc. So I did it but when I loop to look the pixels it returns me 0 or 4294967295. I searched…

PsyKozZ09
- 21
- 3
1
vote
2 answers
PyAutoGui still not showing correct RGB pixel values on MacOS python3.8
I want to get the RGB value of the current mouse position on my macbook screen.
Right now it is not showing correct: When I hover my mouse over a black image the RGB values don't go near (0, 0, 0) it stays like (181, 201, 233). When I put my mouse…

Mike Willems
- 11
- 1
1
vote
1 answer
Ambiguous pywintypes.error when calling win32gui.GetPixel()
So here's the line of code triggering the error:
win32gui.GetPixel(win32gui.GetDC(self._hwndGame), x, y)
Here's the error:
pywintypes.error: (0, 'GetPixel', 'No error message is available')
I'm not sure how to interpret this error or where to…

xurdm
- 21
- 4
1
vote
3 answers
Get RGBValues of Bitmap in Android
I'm having some issues getting the RGB values of a bitmap in Android...
This is what I'm doing:
int[] temp = new int[width*height];
bit.getPixels(temp, 0, width, 0, 0, width, height);
However, the colors don't seem to match the typical RGB values.…

Kevin
- 127
- 1
- 7
1
vote
1 answer
Manipulating JPEG images pixel-per-pixel using Mini Jpeg Decoder
I want to manipulate JPEG images with C++ using the decoder Mini Jpeg Decoder.
The problem is: I want to read pixel per pixel, but the decoder only returns an imageData-array, similar as libjpeg does.
I can't make a method like this:
char…

cafaxo
- 187
- 8
1
vote
2 answers
Lost information getting pdf page as image
I am not an expert in any sense, I am trying to extract a pdf page as an image to do some processing later. I used the following code for that, that I built from other recommendations in this page.
import fitz
from PIL import Image
dir =…

José Chamorro
- 497
- 1
- 6
- 21
1
vote
1 answer
Colorcode License Plate/GetPixel Method
I'm working on a License Plate Recognition program in C#.
On this moment I need the ARGB color code of the license plate, which is done, and I need the ARGB code of the letters/numbers of the license plate. I used the GetPixel method to get the ARGB…

Steve
- 31
- 2
1
vote
0 answers
Python: win32gui.GetPixel() fails when righ-clicking with mouse
I need to track pixels on my screen very fast, but win32gui.GetPixel() is failing when I right-click with my mouse a few times.
I managed to reproduce the same error right-clicking fast with the mouse anywhere on the screen while below code is…

Hugo
- 147
- 1
- 7
1
vote
0 answers
C# Get pixel location from Image<,> EMGU CV 3.3
I've been working on an EMGU based project where i need to create a skeleton image with the ZhangSuen thinning algorithm, which works perfectly fine. For further analysis I want to obtain all pixel locations of the skeleton and store them in a…

Kajij
- 11
- 1
- 2
1
vote
1 answer
VB .NET picture GetPixel & SetPixel: Include alpha?
I am trying to use GetPixel and SetPixel to copy the contents of one picture to another (I know there are other methods to do so, but there are reasons I want to try this ;D)
Anyway, the pictures are .png images, so they include transparency…

Saturn
- 17,888
- 49
- 145
- 271