Issue with ChangeContrast and ChangeBrightness

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
isoler
Posts: 3
Joined: Thu Apr 06, 2017 1:01 pm

Issue with ChangeContrast and ChangeBrightness

Post by isoler » Thu Apr 06, 2017 1:06 pm

Hello,

we are currently evaluating your product to use it in out image acquisition application. As part of the evaluation we were trying to use the AcquiredImage ChangeContrast and ChangeBrightness methods and the results are not the expected ones.

If we do a loop calling any of the two methods with positive and negative values (+20 , -20 for example) we end up with a black or white image, we expected to have always the same image as -20 should leave the original image after doing a +20. Looks like the process is somehow 'destructive'.

Is this normal or are we missunderstanding something?

Regards.

Alex
Site Admin
Posts: 1460
Joined: Thu Jul 10, 2008 2:21 pm

Re: Issue with ChangeContrast and ChangeBrightness

Post by Alex » Thu Apr 06, 2017 4:49 pm

Hello,

The ChangeContrast and ChangeBrightness methods get the pixel value from image, process the pixel value and save the processed pixel value back to the image. Minimum pixel value is 0, maximum pixel value is 255. When you increasing (+20) the contrast for pixels with colors (235, 234, ..., 254, 255), all pixels values will be set to 255. When you decreasing (-20) the contrast for pixels with colors (0, 1, ..., 19, 20), all pixels values will be set to 0. In other words the ChangeContrast and ChangeBrightness methods can lose the image information. I hope I answered to your question.

Best regards, Alexander

isoler
Posts: 3
Joined: Thu Apr 06, 2017 1:01 pm

Re: Issue with ChangeContrast and ChangeBrightness

Post by isoler » Fri Apr 07, 2017 9:55 am

Makes sense.

Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest