Grey Scale mode creating very large tiff files

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
rlella
Posts: 8
Joined: Thu Mar 11, 2010 3:10 pm

Grey Scale mode creating very large tiff files

Post by rlella » Thu Mar 11, 2010 3:38 pm

Hello,

I am using GDPicture.Net version 6.1.0.9 in a desktop application created in .net framework 3.5.
The scanner I am using is HP LaserJet 3055.

The issue is that when I am scanning a single page with the following settings, the size of the tiff file getting created in the order of 1.5 MB (1493 KB):
m_gdPictureImaging.TwainSetResolution(200);
m_gdPictureImaging.TwainSetPixelType(TwainPixelType.TWPT_GRAY);
m_gdPictureImaging.TwainSetBitDepth(1);

I have used the compression: TwainCompression.TWCP_PACKBITS but with no significant reduction in size. I have used other values like JPEG, BITFIELDS, LZW with just minute effects.

Interestingly, when I use the same settings and scan using the HP scanner software, it creates a tiff file of less than 100 KB.
I have a requirement to scan more than 100 pages in a single tiff file. Using these statistics it is getting way too huge (more than 100 MB).

What could be the reason for this behaviour?

Regards,
Rajeev Lella

User avatar
Loïc
Site Admin
Posts: 5671
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Grey Scale mode creating very large tiff files

Post by Loïc » Thu Mar 11, 2010 4:47 pm

Hi,

You can use the JPEG compression scheme to reduce the size of your created tiff image.

IE:

Code: Select all

oGdPictureImaging.SaveAsTIFF(ImageID, "image.tif", GdPicture.TiffCompression.TiffCompressionJPEG)
With best regards,

Loïc

rlella
Posts: 8
Joined: Thu Mar 11, 2010 3:10 pm

Re: Grey Scale mode creating very large tiff files

Post by rlella » Mon Mar 15, 2010 7:48 am

Thanks for the reply Loic.
Since I have a requirement to save multipage tiff, I used the method TiffSaveAsMultiPageFile. The results were the same.
I did some more testing and found out a very wiered behaviour. When we invoke the properties window (TwainSetHideUI) of the HP Scanner and scan via it, the file sizes are dramatically reduced in Grey Scale (2000 KB to 650 KB).
And when I scan the same page without invoking the properties window, the file size is back to 2000 KB.

Do you have any clue regarding this behaviour?

The scanner we are using is: HP Laser Jet 3055.

Regards,
Rajeev

britnis
Posts: 18
Joined: Tue Sep 02, 2008 12:47 pm

Re: Grey Scale mode creating very large tiff files

Post by britnis » Tue Mar 16, 2010 11:47 am

Hello Loic,

Any updates on this issue.

I face the same issue with the Gd Picture Pro Activex version 5.12.4. My development environment is VB6.0.

As explained in this thread earlier by Rajeev, I am facing issue with saving the scanned tiff images with a lesser size.

To brief the scenario:

1. I scanned a document using HP Scanner 3055 All-in-One. The size of the output tiff file is 133KB.

2. The same document, when scanned using the utility that we developed on Gd Picture Pro 5.12.4 gives me 380 KB.

3. I have also tried to set the either of the following:

Code: Select all

Imaging1.TwainSetCurrentCompression (TWCP_JPEG)
or

Code: Select all

 Imaging1.TwainSetCurrentCompression (TWCP_LZW)
But, this is not set as expected, as the

Code: Select all

call Imaging1.TwainGetCurrentCompression
returns 0. The expected output is 6 and 7 accordingly.

4. Hence, the scan output gives me the size of 1.5MB while my expected output is 133 KB.

5. Though I could reduce the size of the image from 1.5MB to 306KB using Conversion method like

Code: Select all

Imaging1.ConvertTo4BppQ
the size is still twice the size of the same image obtained from HP Scanner software [HP software Scanned image has Better Quality too]. This increase in size is to be addressed at the earliest.

Note: Even the quaility of the image reduces, after using the conversion to 4BppQ.

Please provide me suggestions for the following queries:
A. Why is the file size difference between the images scanned by Gd Picture Pro and HP Scanner software?
B. What can be the solution to reduce the file size of the Multipage Tiff images without compromising the quality?

I look forward to your valuable suggestions at the earliest.

Regards,
Britnis

rlella
Posts: 8
Joined: Thu Mar 11, 2010 3:10 pm

Re: Grey Scale mode creating very large tiff files

Post by rlella » Fri Mar 19, 2010 11:04 am

Use Brightness in GdPictureImage Control. After apply this setting the results are good and image file size reduce by 1/3 of original file file.

oGdPictureImaging.TwainSetAutoBrightness(false);
oGdPictureImaging.TwainSetBrightness(400); // Or 325

User avatar
Loïc
Site Admin
Posts: 5671
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Grey Scale mode creating very large tiff files

Post by Loïc » Fri Mar 19, 2010 12:03 pm

Hi,

Please note:

- JPEG compression in tiff is available only for grayscale & true color image.
- If you call ConvertTo4BppQ() you will not be able to save your image using JPEG compression.

What I can suggest is to convert the image in 8bpp gray using the ConvertTo8BppGrayScale method.

With best regards,

Loïc Carrère

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest