GetPixel is a Windows GDI API function which retrieves the RGB color value of the pixel at a specific coordinates.
Questions tagged [getpixel]
187 questions
2
votes
1 answer
How to get all the pixel data (RGB) of an image through c++
From a JPG or PNG file, I want pixel data in the form of 2D array.
What is the procedure to do it OR which libraries can do that task?
![](../../users/profiles/6154255.webp)
Sparrow
- 65
- 9
2
votes
3 answers
Perl & Image::Magick, getting color values by pixel
I'm using Perl and the Image::Magick module to process some JPEGs.
I'm using the GetPixels sub to get the RGB components of each pixel.
e.g.
my @pixels = $img->GetPixels(
width => 1,
height => 1,
x => 0,
y =>…
![](../../users/profiles/71062.webp)
aidan
- 8,576
- 8
- 65
- 78
2
votes
2 answers
Find pixel where max width and max height of a coloured area intersect using GetPixel()
I'm using GetPixel to get the colour of each pixel of an image. The images contain different plain-coloured irregular shapes, and I'd like to find the point (or pixel) where the maximum width matches the maximum height (see figure below).
(source:…
![](../../users/profiles/149303.webp)
pastapockets
- 1,008
- 2
- 12
- 20
2
votes
2 answers
C# How do I convert my get GetPixel / SetPixel color processing to Lockbits?
EDIT: I deeply appreciate the replies. What I need more than anything here is sample code for what I do with the few lines of code in the nested loop, since that's what works right in GetPixel/SetPixel, but also what I can't get to work right…
![](../../users/profiles/4698560.webp)
MaoTseTongue
- 71
- 2
- 8
2
votes
2 answers
GetPixel returns incorrect values
This is my first post on this forum, please don't go hard on me if I didn't post it in the right place or if I did something wrong, I don't post in forums very much. So, I have this problem with GetPixel function. Basically, it should return the…
![](../../users/profiles/4795931.webp)
Sakire Sileteik
- 21
- 3
2
votes
1 answer
Result of Color.GetPixel().equals(Color.Blue) comes out false
Color c1 = image.GetPixel (7, 400);
Color c2 = Color.Blue;
Console.WriteLine (image.GetPixel (7, 400));
Console.WriteLine (Color.Blue);
Console.WriteLine (c1.Equals(c2));
Console output:
Color [A=255, R=0, G=0, B=255]
Color [Blue]
False
I'm new to…
![](../../users/profiles/4645288.webp)
xglide
- 55
- 1
- 6
2
votes
1 answer
Get pixels from IDirect3DSurface9?
I want to get a fast access to the pixels of a game which uses directX9 or 10. Therefore I used the D3D9 library. Do I have to use the D3D10 library when it is a directX10 game? If this is true, the next part is irrelevant.
The following code works…
![](../../users/profiles/4291158.webp)
Jens Metzner
- 109
- 1
- 12
2
votes
1 answer
Getting color from external image using JavaScript
So, I have tried looking this up in many places, but have not yet found an answer for my situation.
What I have is a loop, looping for each hour in a day for every day in a year, and, with many insanely ridiculous mathematical equations, getting the…
![](../../users/profiles/3788803.webp)
brettwbyron
- 95
- 11
2
votes
1 answer
Get Pixel Color on screen Java?
Hello I am trying to get the color of a particular pixel on my JFrame.
This is my code. My frame is red.
The problem I am having is when I click the Frame it should return me the RGB color for red that is (255,0,0) but when I click at different…
![](../../users/profiles/3323742.webp)
user3323742
- 31
- 1
- 4
2
votes
0 answers
Getting the color of a pixel in an ImageView in Android
I am trying to get the color of the spot where I touched on an ImageView. And I succeeded using getPixel(x,y) for getting the color, but on another spot I am not getting the color of the pixel where I touched; I am getting the color of a different…
![](../../users/profiles/1065028.webp)
Jin
- 462
- 1
- 5
- 22
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…
![](../../users/profiles/2608749.webp)
StenBone
- 87
- 8
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 =…
![](../../users/profiles/1356378.webp)
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…
![](../../users/profiles/1190311.webp)
me erum
- 33
- 1
- 1
- 6
1
vote
0 answers
Fast get pixel in OS X + Python
I want to get the rgb value of an arbitrary pixel on the screen. Preferably without having to load a full gui toolkit like qt or gtk. Taking a screenshot works, but it's an expensive operation and I'd like to run this thing in real-time, so I…
![](../../users/profiles/88696.webp)
Jesse Aldridge
- 7,134
- 7
- 41
- 72
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…
![](../../users/profiles/1075991.webp)
Krikler7
- 13
- 4