Grey Scale mode creating very large tiff files
Grey Scale mode creating very large tiff files
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
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
Re: Grey Scale mode creating very large tiff files
Hi,
You can use the JPEG compression scheme to reduce the size of your created tiff image.
IE:
With best regards,
Loïc
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)
Loïc
Re: Grey Scale mode creating very large tiff files
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
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
Re: Grey Scale mode creating very large tiff files
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:
or
But, this is not set as expected, as the 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 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
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)
Code: Select all
Imaging1.TwainSetCurrentCompression (TWCP_LZW)
Code: Select all
call Imaging1.TwainGetCurrentCompression
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
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
Re: Grey Scale mode creating very large tiff files
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
oGdPictureImaging.TwainSetAutoBrightness(false);
oGdPictureImaging.TwainSetBrightness(400); // Or 325
Re: Grey Scale mode creating very large tiff files
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
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
Who is online
Users browsing this forum: No registered users and 1 guest