Microsoft Windows Image Acquisition Library very large scan file size

wackywoo105

Registered User.
Local time
Today, 14:48
Joined
Mar 14, 2014
Messages
203
[Solved] Microsoft Windows Image Acquisition Library very large scan file size

I am using the Microsoft Windows Image Acquisition Library to scan directly from a button in an access form.

I am using this to scan A4 files at resolution 200dpi in greyscale to jpeg. The scans captured by my access code are 3785KB in size. If I run the same scan using devices and printer the file size is 685KB.

I have the following set up:

Code:
 [COLOR=#333333][FONT=Verdana]With wiaScanner.Items(1)[/FONT][/COLOR]
 [COLOR=#333333][FONT=Verdana]    .Properties("6146").Value = 2 '4 is Black-white,gray is 2, color 1 (Color Intent)[/FONT][/COLOR]
 [COLOR=#333333][FONT=Verdana]    .Properties("6147").Value = 200 'dots per inch/horizontal[/FONT][/COLOR]
 [COLOR=#333333][FONT=Verdana]    .Properties("6148").Value = 200 'dots per inch/vertical[/FONT][/COLOR]
 [COLOR=#333333][FONT=Verdana]    .Properties("6149").Value = 0 'x point where to start scan[/FONT][/COLOR]
 [COLOR=#333333][FONT=Verdana]    .Properties("6150").Value = 0 'y-point where to start scan[/FONT][/COLOR]
 [COLOR=#333333][FONT=Verdana]    .Properties("6151").Value = 1660 'horizontal exent DPI x inches wide[/FONT][/COLOR]
 [COLOR=#333333][FONT=Verdana]    .Properties("6152").Value = 2334 'vertical extent DPI x inches tall[/FONT][/COLOR]
 [COLOR=#333333][FONT=Verdana]    Set wiaImg = .Transfer(wiaFormatJPEG) 'Change file type in save to match format[/FONT][/COLOR]
 [COLOR=#333333][FONT=Verdana]End With[/FONT][/COLOR]
Does anyone know why the access scans are so large?
Comparing the 2 images captured by different methods shows no real difference in quality.
 
Last edited:
Rough guess, different compression levels are being used - is there another property you can set for jpeg quality/compression?
 
That is something I didn't think of. I didn't write the code so don't have a full understanding of what can be set but I will now search along those lines.
 
I have found a reference to Compression = 4107. This seems to be set at 0. Any other values I try to enter produce an error.

Does anyone have an idea of what values I can use before I just try loads?

There is also:

Bits Per Pixel = 4104
Bits Per Channel = 4110
Channels Per Pixel = 4109

in case they can be any help.
 
After some extensive research found a way with ImageProcess to reduce the file size.

Code:
Dim IP As ImageProcess
Set IP = CreateObject("WIA.ImageProcess")
IP.Filters.Add (IP.FilterInfos("Convert").FilterID)
IP.Filters(1).Properties("FormatID").Value = wia.FormatID.wiaFormatJPEG
IP.Filters(1).Properties("Quality").Value = 40
Set wiaImg = IP.Apply(wiaImg)
 
Last edited:

Users who are viewing this thread

Back
Top Bottom