When converting a file to TIFF_JPEG with RasterMaster Java, you may see that the resulting TIFF is blank when opened in a third party image viewer such as MS Office Document Imaging or Windows Photo Viewer. In some cases, the viewer may also display an error message indicating that the TIFF is corrupted or too large.

This issue typically occurs when the file in question is converted at 1-bit black and white or 8-bit grayscale, rather than 24-bit color. By default, RasterMaster Java will often choose 1 bit/pixel to ensure better performance during conversion. Formats which are converted to 1-bit by default include AFP, DOC, XLS, and PCL. For these formats, we recommend that you call the IMGLOW_set_document_input() method prior to decompression if you wish to convert to TIFF_JPEG. Please see the following example:

status = s.IMGLOW_set_document_input(200, 24, Defines.DOC);
status = s.IMG_decompress_bitmap("C:\\input\\file.doc", page);
status = s.IMG_save_bitmap("C:\\output\\file.tif", Defines.TIFF_JPEG)

In the above example, the input DPI and bit-depth are set to 200 and 24 respectively for the input DOC file before being converted to TIFF_JPEG.

Please also note that while color input images (e.g. JPEG, TIFF, PNG) will be converted to 24 bits/pixel by default, you still might see this issue for black and white or grayscale input images. In the case where your input file is a black and white or grayscale image, you can promote the bit-depth to 24 by calling IMG_promote_24() after decompression. Please see the following example:

status = s.IMG_decompress_bitmap("C:\\input\\file.png", page);
status = s.IMG_promote_24();
status = s.IMG_save_bitmap("C:\\output\\file.tif", Defines.TIFF_JPEG)

This should produce an output TIFF that can be viewed by most third party image viewers.