Convert to blackandwhite gdimaging v9.4

Discussions about image processing and document imaging.
Post Reply
asciiman
Posts: 4
Joined: Mon Dec 22, 2014 5:14 pm

Convert to blackandwhite gdimaging v9.4

Post by asciiman » Mon Dec 22, 2014 6:07 pm

hi,
I am creating Colored MultiPageTiff from scanned pages.

Code: Select all

_gdImaging.TwainSetBitDepth( 24 );	// 24 bit
_gdImaging.TwainSetPixelType(GdPicture9.TwainPixelType.TWPT_RGB)

    int xGDImageID = _gdImaging.TwainAcquireToGdPictureImage(this.Handle);
    if (xGDImageID != 0)
    {
        if (_MultiPageID == 0)
            _MultiPageID = _gdImaging.TiffCreateMultiPageFromGdPictureImage(xGDImageID);
        else
            _gdImaging.TiffAppendPageFromGdPictureImage(_MultiPageID, xGDImageID);
	}
I wanna save each page blackandwhite pdf.

Code: Select all

            int BlackAndWhiteImageID = _gdImaging.CreateClonedGdPictureImageI(_MultiPageID);
            _gdImaging.FxBlackNWhite(BlackAndWhiteImageID, GdPicture9.BitonalReduction.OrderedDither);  // NearestColor, OrderedDither, Burke, Stucki, FloydSteinberg
            _gdImaging.ConvertTo1Bpp(BlackAndWhiteImageID);
after saving

Code: Select all

            for (int xIndex = 1; xIndex <= xPageCount; xIndex++)
            {
                _gdImaging.TiffSelectPage(BlackAndWhiteImageID, xIndex);
                _gdImaging.SaveAsPDF(BlackAndWhiteImageID, pdfPath, 
            }
But results are not like BlackAndWhite scanning
Untitled-1.jpg
Orginal BlackAndWhite
Untitled2sd1-2.jpg
Converted
How can i convert blackandwhite from colored tiff for best result?

SamiKharma
Posts: 352
Joined: Tue Sep 27, 2011 11:47 am

Re: Convert to blackandwhite gdimaging v9.4

Post by SamiKharma » Sun Jan 04, 2015 12:22 pm

Hi,

There are many thresholding (binarization) techniques in image processing, some are good for certain conditions while others aren't and visa-versa.
GdPicture has a good set of thresholding mechanisms, to test them, please check the Binarization Sample Demo application, in which you can load your document and see the result of different binarization techniques.

Best,
Sami

asciiman
Posts: 4
Joined: Mon Dec 22, 2014 5:14 pm

Re: Convert to blackandwhite gdimaging v9.4

Post by asciiman » Wed Jan 14, 2015 10:53 am

thnx sir
i try it and i get good result.

best regards

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest