Good evening,

Just want to ask if there's a way to get the contrast and pixeltype(if it's colored/bitonal/grayscale) of an existing image using vb .net such as: gif/jpg/pdf/png/tif
If yes, how?

Godbless and thanks in advance,

Yap, i did use that, "the image.PixelFormat", but for grayscale and bitonal this will just give same output..

dynamic range? is it the same with the contrast(DPI/dot per inch)?

for example:
Dim i As Image = Image.FromFile(strFilePath)
Dim lngScanType = i.PixelFormat

colored: lngScanType = 137224
grayscale: lngScanType = 2498570
bitonal: lngScanType = 2498570

Bitonal: .NET doesn't distinguish 1-bit color... I guess you'll have to scan through the pixels and count colors, or find a library that will do it for you.

Contrast: There are multiple ways to define a contrast value. Dynamic range is a simpler, related measure.

The term bitonal often refers to 1-bit images that have specifically pure black and pure white colors. You can probably examine the colors of the image using the Image.Palette property to see if they meet this requirement.

About contrast, there's a post that explains one way of comparing contrast with a nice explanatory screenshot image here:

This article has been dead for over six months. Start a new discussion instead.