|Top Previous Next|
The -filetype parameter determines the image file type that will be saved. If -filetype is not specified, the file type will be a Windows BMP file. If the -multipage option is used, the file will be a multipaged image file (only TIFF, PCX, PDF, and PostScript formats allow multi-page image files).
TwainSave can save files using one of two modes:
Below will be a brief description of each mode:
For most users, the first mode, mode 1, is sufficient for most uses of TwainSave. In addition, all TWAIN devices are able to save files using these file types. It doesn't matter if it is an inexpensive TWAIN digital camera, or a sophisticated TWAIN high-end scanner, the device will be able to save to a mode 1 file type.
The valid values for -filetype that save files in mode 1 are as follows:
Example: Acquire to a Group 3 TIFF format, the file is called mytif.tif:
twainsave -filetype tif3 -filename mytif.tif
This mode is for users that are using TWAIN devices that have an internal TWAIN file transfer mechanism. Many TWAIN devices are able to create data files using file formats that mode 1 does not support, or possibly have enhanced versions of the file types that mode 1 supports. Some of these file types are PDF/A, FPX, SPIFF, JBIG, and other file types. To do this, the device's TWAIN driver must have built-in file support and support the file type requested. Note that not all TWAIN devices has built-in file transfer support.
To summarize, mode 2 differs from mode 1 above in the following ways:
The table below shows the various settings for mode 2 file types, however these settings are only available for devices that support such file types.
For mode 2, the -color and -bitsperpixel settings that are available for each file type is defined by the device. If the -color and/or -bitsperpixel options are not specified, TwainSave will attempt to use the first available -color and/or -bitsperpixel setting that the file type will support.
Example: Acquire to a BMP file format using the internal file support, and with the compression type as "none".
twainsave -filetype bmp1_mode2 -filename mytif.bmp
If the device cannot save to the file type specified, this will usually mean one of the following:
The error states that the device is attempting to transfer 8 bit images (usually color or gray scale), but the image format specified (TIFF Group 3) does not support color or gray-scale images.
If the device's user interface is shown, the user may have chosen an incorrect type that matches the format given on the TwainSave command line. Therefore it is highly recommended that if you plan to use TwainSave, and the device's user interface will be available to the user, to select a file format that gives you the most supported types of colors. For example BMP supports both monochrome, gray-scale, and color images, as do all forms of TIFF except for Group 3, Group 4 TIFF, and TIFF-JPEG.
For Mode 1 file types, here are the list of file types and the bits-per-pixel supported for each one:
Below is a table describing the valid bit-depths for each file type:
File Type Bit Depth
1 bit-per-pixel are monochrome (black/white) images.
4 bits-per-pixel are usually gray-scale images.
8 bits-per-pixel are usually gray-scale and 256 color images.
16 and 24 bits-per-pixel are usually color images.
Note: Bit depths higher than 24 should be stored as bmp files.
* Non-Vista Windows ICON format is limited to images that have widths and heights less than 256 pixels. Therefore ICO image file generation may require the -thumbnail option to scale the image to fit the ICO size limits.
For Mode 2 file types, the bits-per-pixel settings are device dependent. Usually these settings match the Mode 1 settings for equivalent formats (for example TIFF), however it is up to the device as to the valid bit-depth settings.
The image type is bmp (Windows BMP Mode 1).