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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sivaraman DhamodaranRank #40 · 34.5K reputationPosted Dec 14, 2014, 8:25 PM EST
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;