VintaSoft Twain .NET SDK Discussions

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

Board index < VintaSoft Twain < VintaSoft Twain .NET SDK Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

AcquiredImage.IsBlank(Single) alters image compression



AcquiredImage.IsBlank(Single) alters image compression

Post by veenasiva »

Hi,

I am using AcquiredImage.IsBlank(Single) to determine if a scanned image is blank.I have noticed that the compression of the image changes to None once this code is executed.
I set device properties as below
  device.TransferMode = TransferMode.Memory;
  device.ShowUI = false;
  device.ShowIndicators = false;
  device.UnitOfMeasure = Vintasoft.Twain.UnitOfMeasure.Inches;
  device.DisableAfterAcquire = false;
  // enable duplex
  device.DocumentFeeder.DuplexEnabled = true;

  device.PixelType = PixelType.BW;
  device.ImageCompression = TwainImageCompression.Group4;
  //resolution
  device.SetResolution(300, 300);
  device.Acquire();
In debug mode i can see that the image compression is Group4, but immediately after execution of code in if statement below(this code is inside device_imageAcquired) image compression changes to None.
  if (e.Image.IsBlank(0.01f))
  {
  }
I need to know how to retain the compression set initially.

Veena


Re: AcquiredImage.IsBlank(Single) alters image compression

Post by Alex »

Hello Veena,

SDK "unpacks" image data before processing an image.

Why do you need to retain initial compression after image processing? Please let me know all actions, which you do with scanned image.

Best regards, Alexander


Re: AcquiredImage.IsBlank(Single) alters image compression

Post by veenasiva »

Hi Alex,

Thanks, We are not processing the image after scan.Below are the steps that we do.
1. Open device manager
2. Open device
3. set device properties
4. Scan/Acquire Image
5. During Image Acquisition check if image is blank
6. If not blank save image to disk.

Without compression the image size differs(almost doubles/triples when scanned in color) as compared to compressed image size.

Thanks


Re: AcquiredImage.IsBlank(Single) alters image compression

Post by Alex »

Hi Veena,

Thank you for information. In next minor release, which will be available next week, we will add the ability to disable the image data decompressing during image processing.

Without compression the image size differs(almost doubles/triples when scanned in color) as compared to compressed image size. In most cases TWAIN drivers compress color images using JPEG compression. For getting better image file size you also need to use JPEG compression.

Best regards, Alexander


Re: AcquiredImage.IsBlank(Single) alters image compression

Post by veenasiva »

Thank you,yes i am using jpeg for color and group4 for B&W.


Re: AcquiredImage.IsBlank(Single) alters image compression

Post by Alex »

Hi Veena,

In version 10.3.5.1 we have added the AcquiredImage.RetainDataCompression property, which allows to disable the image data uncompression after image processing. Please use version 10.3.5.1 and let me know if you will have any question or problem.

Best regards, Alexander


Page 1 from 1: 1