CropBlackBands problem
CropBlackBands problem
Hi
I am testing GdTwain (lite version) and I have a problem with CropBlackBands
It just doesnt do anything with the picture (example is attached) I tried changing tresholds (0, 20, 50, 75...)
Before CropBlackBands I did CropBorders (which works nice)
I am working with VB6 and latest OCX from the webiste (well... from three days ago)
Thanks,
B
I am testing GdTwain (lite version) and I have a problem with CropBlackBands
It just doesnt do anything with the picture (example is attached) I tried changing tresholds (0, 20, 50, 75...)
Before CropBlackBands I did CropBorders (which works nice)
I am working with VB6 and latest OCX from the webiste (well... from three days ago)
Thanks,
B
- Attachments
-
- probaP.6.tif (1.16 MiB) Viewed 4233 times
Re: CropBlackBands problem
Hi,
Your image is a true color image. The borders are not realy black, they are greyscale.
The CropBlackBands() & CropWhiteBands() methods are optimized to work with true Black and true White color in 1bpp bitmap.
For non indexed color bitmap, you need to use the CropBorders() method like you did
Best regards,
Loïc Carrère
Your image is a true color image. The borders are not realy black, they are greyscale.
The CropBlackBands() & CropWhiteBands() methods are optimized to work with true Black and true White color in 1bpp bitmap.
For non indexed color bitmap, you need to use the CropBorders() method like you did
Best regards,
Loïc Carrère
Re: CropBlackBands problem
Hi,
Thanks for your answer... but what is need for treshold parameter if it works with BW pictures only?
I am scanning with ADF and my scan was originaly greyscale 8bit, I mistakenly saved it as 24 bit.
CropBorders() fixed the problem with white border around image and that was great.. just I have to crop the blacks too ... any othere way (except manual crop)
Thanks,
B.
Thanks for your answer... but what is need for treshold parameter if it works with BW pictures only?
I am scanning with ADF and my scan was originaly greyscale 8bit, I mistakenly saved it as 24 bit.
CropBorders() fixed the problem with white border around image and that was great.. just I have to crop the blacks too ... any othere way (except manual crop)
Thanks,
B.
Re: CropBlackBands problem
Hi again
CropBlackBands() works if scanner brightness is set to 0.
If brightness is set to 1 it will not work ... well... range of brightness setup is -1000 to 1000 so that value of 1 one should not realy make any difference since it's 8 bit and brightness of 1 should lift the black for about 1/2000 value (right?) and that's no change
Any ideas?
B.
CropBlackBands() works if scanner brightness is set to 0.
If brightness is set to 1 it will not work ... well... range of brightness setup is -1000 to 1000 so that value of 1 one should not realy make any difference since it's 8 bit and brightness of 1 should lift the black for about 1/2000 value (right?) and that's no change
Any ideas?
B.
Re: CropBlackBands problem
HI,
I' ve tried CropBorders() on your uploaded image with perfect result. Maybe you need to call this method two times ??
In fact, CropBlackBands() & CropWhiteBands() methods should be used only on 1 bpp image. These methods are checking only for full white RGB(255, 255, 255) or full Black RGB(0, 0, 0) colors.
It is another issue but I can say that:
- For index color bitmap it is not working like that. 8bpp image can handle only 256 different colors. Therefore 1/2000 range can't make any sense.
- For true color image it depend of your acquisition device. you can use the TwainGetCapRangeNumeric() method to cath the supported brightness values:
https://www.gdpicture.com/guides/gdpicture/v4/gdtwainp ... meric.html
Best regards,
Loïc
I' ve tried CropBorders() on your uploaded image with perfect result. Maybe you need to call this method two times ??
In fact, CropBlackBands() & CropWhiteBands() methods should be used only on 1 bpp image. These methods are checking only for full white RGB(255, 255, 255) or full Black RGB(0, 0, 0) colors.
Code: Select all
range of brightness setup is -1000 to 1000 so that value of 1 one should not realy make any difference since it's 8 bit and brightness of 1 should lift the black for about 1/2000 value (right?) and that's no change
- For index color bitmap it is not working like that. 8bpp image can handle only 256 different colors. Therefore 1/2000 range can't make any sense.
- For true color image it depend of your acquisition device. you can use the TwainGetCapRangeNumeric() method to cath the supported brightness values:
https://www.gdpicture.com/guides/gdpicture/v4/gdtwainp ... meric.html
Code: Select all
Dim bSuccess As Boolean
Dim nMinValue As Double, nMaxValue As Double, nStepValue As Double
bSuccess = Twain1.TwainGetCapRangeNumeric(ICAP_BRIGHTNESS, nMinValue, nMaxValue, nStepValue)
Best regards,
Loïc
Re: CropBlackBands problem
Thank you for your answer.
Re: CropBlackBands problem
You are welcome !
Best regards,
Loïc
Best regards,
Loïc
Who is online
Users browsing this forum: No registered users and 0 guests