Image Processing [modified]
-
Hi. I want to do some works with a picture and need to work with pixels. but the getpixel(,),setpixel(,,) functions in a loop are very slow. is there a way to get or set pixels faster. my code is like this:
Bitmap myBmp = new Bitmap("filename");
Color p = new Color();
int i,j;
for(i=0 ; i < myBmp.Width ; i++)
{
for(j=0 ; j < myBmp.Height ; j++)
{
p = myBmp.GetPixel(i,j);
if(p.R <= 250) p.R += 5;
if(p.G <= 250) p.G += 5;
if(p.B <= 250) p.B += 5;
myBmp.SetPixel(i,j,p);
}
}erfan -- modified at 8:01 Sunday 23rd July, 2006
modified on Thursday, February 12, 2009 5:07 AM
-
Hi. I want to do some works with a picture and need to work with pixels. but the getpixel(,),setpixel(,,) functions in a loop are very slow. is there a way to get or set pixels faster. my code is like this:
Bitmap myBmp = new Bitmap("filename");
Color p = new Color();
int i,j;
for(i=0 ; i < myBmp.Width ; i++)
{
for(j=0 ; j < myBmp.Height ; j++)
{
p = myBmp.GetPixel(i,j);
if(p.R <= 250) p.R += 5;
if(p.G <= 250) p.G += 5;
if(p.B <= 250) p.B += 5;
myBmp.SetPixel(i,j,p);
}
}erfan -- modified at 8:01 Sunday 23rd July, 2006
modified on Thursday, February 12, 2009 5:07 AM
Hi! Just use the search function to find Christian Grauss' excellent articles on image processing.
Regards, mav -- Black holes are the places where god divided by 0...
-
Hi! Just use the search function to find Christian Grauss' excellent articles on image processing.
Regards, mav -- Black holes are the places where god divided by 0...
-
:wtf: My answer was that there are articles here on CP telling you how to solve your problem, you just have to search! If you're unable to find the search button, you can try this page instead.[^]
Regards, mav -- Black holes are the places where god divided by 0...