1997.05.23 20:42 "Windows WIN32 DIB DLL available", by Richard J. Kinch

1997.05.23 20:42 "Windows WIN32 DIB DLL available", by Richard J. Kinch

I have developed a WIN32 DLL that returns a Windows DIB (device-independent bitmap object) given a TIFF file, based on libtiff. I would like to hear from those who would like to help test and use such a component.

My own motivation was a reluctance to pay $600 to upgrade a 16-bit version of a TIFF DLL that I had already paid $500 for (used in my commercial product, a TeX typesetting package called TrueTeX). There are perhaps a half-dozen such TIFF DLL's available, all commercial and ranging in price from $300 to $1000, usually royalty-free, but I found them all and without exception to be seriously buggy, especially when applied to more exotic TIFF formats. My experience with libtiff in Unix was much better. So, standing on the solid shoulders of libtiff, I reached for the "make" side of the "make or buy" decision.

DIB's are the easiest and most flexible way for a Windows application to manipulate images, but since DIB's have a limited variety of representations (paletted bitmaps of 1-, 4-, or 8-bits/pixel, plus 16- and 24-bit RGB), there is some work involved (done by this DLL) to properly convert the richer TIFF variety. The DIB DLL converts TIFF grayscale images optimally using libtiff scanline reading; for "deeper" images it simply falls back to the cruder libtiff RGBA routines to create an approximate (and possibly inefficient) 24-bit RGB DIB. Thus, anything libtiff can read, this DLL will turn into a DIB in a more or less accurate and efficient form. The conversions, plus the straight mechanics of DIB creation, are done in a single additional C source file of about 500 lines.

I have also created a makefile for MSVC++ 5.0 to build the DIB code and the libtiff routines into a DLL. Since I do a lot of both Unix and WIN32 development, and even wrote my own TIFF reader from scratch years ago, I have been able to do this in the "correct" way.

At this point the code is pretty robust and handles almost all the formats, within the limitations of libtiff. The hope is to have a complete baseline reader, plus whatever else libtiff will support.

If this is something you could use and are willing to help test (that is, you write WIN32 applications that use DIB's), send me your e-mail address and I will reply with a UUencoded ZIP file, containing the DLL, sample code, and documentation. Whether the finished product will be free and reflected into Sam's master libtiff has not yet been decided, but all testers will receive a free, final copy.