Questions tagged [getpixel]

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

187 questions
50
votes
4 answers

C# - Faster Alternatives to SetPixel and GetPixel for Bitmaps for Windows Forms App

I am trying to teach myself C# and have heard from a variety of sources that the functions get and setpixel can be horribly slow. What are some of the alternatives and is the performance improvement really that significant? Thanks in advance! A…
purdoo
  • 852
  • 1
  • 10
  • 16
36
votes
3 answers

OpenCV get pixel channel value from Mat image

Maybe I'm not looking hard enough, but everything seems to want me to use an array. Thus, how do I get the channel value for a particular pixel for foo if foo is something like Mat foo = imread("bar.png")?
HRÓÐÓLFR
  • 5,494
  • 5
  • 30
  • 32
14
votes
2 answers

How to edit/read pixel values in OpenCv from Mat variable?

I am looking for an efficient way for editing/reading pixels from Mat (or Mat3b) variable. I have used :- Image.at(i,j) but it seems to be very slow. I also used this:- A.data[A.channels()*A.cols*i + j + 0] but the problem I am facing with…
Ravi Upadhyay
  • 314
  • 1
  • 3
  • 16
14
votes
3 answers

QT QImage pixel manipulation

I am building a QT GUI application and use QImage for opening images. My problem is that I can't figure out how to use QImage's bit() and scanline() methods to get access at per pixel level. I've seen this post Qt QImage pixel manipulation…
theosem
  • 1,144
  • 3
  • 10
  • 21
9
votes
2 answers

How to get a Bitmap from VectorDrawable

I'm still trying to solve the problem I've had since a couple of days ago and I still have not found a solution. However, I am getting there step by step. Now I have run into another roadblock. I am trying to get Bitmap.getpixel(int x, int y) to…
8
votes
2 answers

Get Pixel color fastest way?

I'm trying to make an auto-cliker for an windows app. It works well, but it's incredibly slow! I'm currently using the method "getPixel" which reloads an array everytime it's called. Here is my current code: hdc = GetDC(HWND_DESKTOP); bx =…
Manitoba
  • 8,172
  • 9
  • 53
  • 110
5
votes
1 answer

C# get pixel color from another window

I want to get a pixel color from another window. The code I have is: using System; using System.Drawing; using System.Runtime.InteropServices; sealed class Win32 { [DllImport("user32.dll")] static extern IntPtr GetDC(IntPtr…
4
votes
1 answer

How to compare a Color by the GetPixel Method and a Color passed in a method like Color.Black?

I have a loop that gets pixelcolors from an image and try to see if they are the same as the Color I passed into the method as parameter. I tried the Equals method but it doesn't work. I also tried the ToKnown method. It looks like that match…
Relok
  • 279
  • 4
  • 13
4
votes
0 answers

Convert plot into pixels in R

Does anyone know how to convert a simple plot into png_format without saving the picture...? In other words, I look for the most straight forward and fastest way to convert a simple plot into pixels, if it is not already (see code below)... EDIT:…
Robert
  • 133
  • 8
4
votes
3 answers

Huge negative values extracted by using getPixel() method

I am having a problem with an image processing app I am developing (newbie here). I am trying to extract the value of specific pixels by using the getPixel() method. I am having a problem though. The number I get from this method is a huge negative…
max_tech91
  • 47
  • 4
4
votes
1 answer

Node.js: Efficient access of values in ndarray for pixel reading

I'm using npm:get-pixels which returns an ndarray and I'm having some trouble understanding how to correctly work this array. Assuming pixels is the ndarray console.log(pixels.get(800, 200, 0)); console.log(pixels.get(800, 200,…
Fletch
  • 380
  • 1
  • 14
4
votes
2 answers

How to filter a specific color from a bitmapData object (or byte-array)

I'm looking for an efficient way to filter a specific color from a bitmapData object in ActionScript 3. Currently I use a loop with readByte32(). This takes about a second to process which is unacceptable. I have been trying to get paletteMap()…
user372950
  • 43
  • 1
  • 4
4
votes
1 answer

How to get pixel value of Black and White Image?

I making App in netbeans platform using java Swing and JAI. In this i want to do image processing. I capture .tiff black and white image using X-Ray gun. after that i want to plot histogram of that Black and White image. so, for plot to histogram ,…
Jay
  • 1,215
  • 10
  • 28
  • 47
3
votes
1 answer

optimal pixel-read back strategy

I need to render certain scenes and read the whole image back in main memory. I've search for this and it seems that most video cards will accelerate the rendering but the read-back will be very slow. After a bit of research i only found this card…
lurscher
  • 23,085
  • 26
  • 113
  • 178
3
votes
1 answer

VBA Get Colour of Pixel

I'm importing images into Excel, and trying to calculate the average colour for a user-defined area of the image. To do that, the user creates a boundary and then I loop through the screen pixels to see whether or not they fall within this boundary…
Nat Aes
  • 825
  • 3
  • 15
  • 33
1
2 3
12 13