recommendation for optimized configuration

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

Moderator: Alex

Post Reply
Posts: 5
Joined: Thu Nov 24, 2011 3:46 pm

recommendation for optimized configuration

Post by quicoli » Tue Feb 18, 2014 4:33 am

Hi friends,

I'm using the following code to scan a A4 sheet into jpg file. The document is only a letter (full page). When using Gray Scale, the jpg generated gets 650kb. Is there a way to optimize this?

Thank you

Code: Select all

            switch (opt.Colors)
                case Color.BW:
                    _device.PixelType = PixelType.BW;
                    _device.BitDepth = 1;
                case Color.Gray:
                    _device.PixelType = PixelType.Gray;
                case Color.Color:
                    _device.PixelType = PixelType.RGB;
                    _device.PixelType = PixelType.BW;
                    _device.BitDepth = 1;

           _device.AcquiredImages.JpegQuality = 80;
           _device.TransferMode = TransferMode.Memory;

           _device.UnitOfMeasure = UnitOfMeasure.Inches;
           _device.Resolution = new Resolution(200f, 200f);
           // custom area to scan are in centimeters, so, I convert it.
          _device.ImageLayout.Set(0, 0, (float)(opt.Size.Width / 2.54), (float)(opt.Size.Heigth / 2.54));

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

Re: recommendation for optimized configuration

Post by Alex » Tue Feb 18, 2014 4:09 pm

Hello Paulo,

Please try to save grayscale image as PNG or TIFF file, I think you will get better compression results.

Best regards, Alexander

Post Reply