raveling@isi.edu (Paul Raveling) (03/08/90)
Version 1.2 of the Img Software Set is available for anonymous ftp from either: venera.isi.edu: pub/img_1.2.tar.Z or expo.lcs.mit.edu: contrib/img_1.2.tar.Z Version 1.2 includes some minor bug fixes, but its main change is replacement of the old color quantization algorithm with the new one I've mentioned in comp.graphics. The new algorithm is much faster and appears to produce distinctly better image quality. Image rendition may be slightly surprising when quantizing to a VERY low number of colors, but it's intended to work well when combined with color dithering. Dithering will be added in version 1.3. For questions, bug reports, or whatever, contact Paul Raveling at "Raveling@isi.edu". Installation ------------ If you have installed the original X11R4 contributed software, version 1.2 of the Img Software Set can be installed as follows: cd $(TOP)/contrib/clients mv img img.original mv [or cp or ftp] img_1.2.tar.Z . uncompress img_1.2.tar.Z tar xvf img_1.2.tar.Z rm img_1.2.tar.Z cd img xmkmf make Makefiles make depend make make install make install.man [alter as desired if you use separate source and build trees] Quantization notes ------------------ You may want to change or experiment with some #defines in module quantize.c. Those with limited memory may need to comment out this definition: #define HIRES_PREQUANT /* Use high resolution prequantization */ Those interested in color quantization algorithms may want to experiment with some parameters in imglib/quantize.c. The easiest controls enabling of timing reports: #define TIME_OVERALL 0 /* Report time from start to finish */ #define TIME_PHASES 0 /* Time phases */ Setting TIME_OVERALL produces a report of both real time and process time used for each quantization. On my HP 9000/370 it appears that a "median" image usually takes around 3 seconds to quantize. High resolution full-screen 24-bit RGB images will be somewhat slower, but 1 to 10 seconds seems like a typical range. Setting TIME_PHASES to 1 will report time used in each phase of quantization. Interesting for the algorithm developer, but gets boring quickly. Don't set both TIME_OVERALL and TIME_PHASES to 1 simultaneously. The algorithm uses a non-Euclidean distance measure in RGB space, with the default being a measure using log**2 terms. You can try any of 4 distance measures by setting these #defines: #define DX_0 1 /* Distance biased for log intensity */ #define DX_1 0 /* Distance biased for intensity */ #define DX_2 0 /* Standard Euclidean 3-space distance */ #define DX_3 0 /* Distance heavily biased for itensity*/ To be sure of exactly what each measure is, search forward for DX_0 (or other variant). You'll find a summary comment block and #defined functions that implement the distance measures. For either a good time or a trip to the insane asylum, try defining your own distance measure and see how it affects quantization. You might want to look at img/imglib/gen*.c, which are little hacks for generating the tables that these macros use. Have fun, folks! ---------------- Paul Raveling Raveling@isi.edu