Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello,

I Am Recently Writing A Program That Reads The Color Of Each Pixel In A Picture.

 

But It Doesn't Took A Short Time. Because, I Must Read Them One By One From CPU.

 

I Think If I Use My GPU for That Process, It Will Take Much Lesser.

 

But I Am Not Sure If I Can Use DirectX or OpenGL to Get Color Value Of A Pixel.

 

If I Can, Just Let Me Know That And If You Have A Documentation, Please Share It.

 

Thank You

Fatih BAKIR

  • Leaders
Posted

You want to examine pixels in a Bitmap?

 

Keep in mind that plenty of software manipulates images without the assistance of the GPU and runs at a more-than-reasonable speed. I'm guessing that your approach involves something along the lines of the GetPixel function, which is terribly slow.

 

A better method is to copy all of the image data into an array of bytes or integers, which is very fast to access. This allows you to quickly scan through the data. Bob Powell posted a good article about this.

[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...