Click here to Skip to main content
15,922,696 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

how can i find whether an image is grayscale or color VB.net.

Thanks,

Sivasankaran G
Posted
Updated 5-Aug-12 19:44pm
v3

Color Scale Filter[^] this article could be help you...
 
Share this answer
 
Hi,
It's quite simple to find the color of the image. Once found the color of the image then compare that. You'll find your type after comparing.
Try this:
C#
Point pt=new Point(10,10);
Bitmap img = Image.FromFile("My File Path");
Color colorAtPoint = img.GetPixel(pt);
//Here you got the color of your image. Compare it with Grayscale


Refer this[^] also for the similar discussion.



--Amit
 
Share this answer
 
Try this,
It will help you.

VB
Dim btmp as Bitmap = Image.FromFile("Your File Path")
Dim clr as Color = btmp.GetPixel(New Point(100,0))


Here clr will have the color at the Point (100,0). You can change it as your wish.
If you want to compare it in the whole image then you can do it using for loop by just changing the point.

Thanks.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900