Hi,
How to check the background color in a uploaded passport size image using c# or jquery ?
Thanks,
Gayatri P
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sivaraman DhamodaranPosted Dec 15, 2014, 1:25 AM
Bitmap bmp = new Bitmap( Your passport size image).
Color Color_at_pixel = bmp.GetPixel(x,y); // x,y is the location you use to check the background color.
Let us say expected background color is blue. This can be tested as (RGB - B is 255) Follows:
if (Color_at_pixel.R == 0 && Color_at_pixel.G == 0 && Color_at_pixel.B == 255)
return true;
else
resturn false;