Merry Christmas all!
I am trying to read .png image.I want to extract each pixel as a vector3d. My code seems to work but it doesn’t give me any values. when i output list count its 0.
Also reading pixels taking lot of time to compute. Is there any faster way?
below is the code! let me know what am I doing wrong.
Bitmap bmp = new Bitmap(“E:\Practice\MERRY CHRISTMAS.png”);
List spots = new List();
for(int i = 0; i < bmp.Width; i++)
for(int j = 0; j < bmp.Height; j++)
Color c = bmp.GetPixel(i, j);
double bright = c.GetBrightness();
if(bright > 1)
spots.Add(new Vector3d(i, j, 0));
A = spots.Count; //this is coming 0