makecolcomp
Description
makecolcomp combines three co-registered 8-bit OMG1 (JHC_header) single-band images (-red, -green, -blue) into a single 8-bit 3-3-2 bit-packed RGB color composite (-out), or prints the corresponding 256-entry RGB lookup table (-print_colormap) for 8-bit pseudocolor displays (jview).
CLI Options & Usage
makecolcomp -red <band_r> -green <band_g> -blue <band_b> -out <comp.8bit> [-hack]
makecolcomp -print_colormap > rgb332.cmap
-red <file> -green <file> -blue <file>: Input 8-bitOMG1band images (must share identicalxmax à ymaxdimensions).-out <comp.8bit>: Output 8-bitOMG1color composite.-hack: Leaves pixels where all three bands are255as255(background) and clamps255composite values to254.-print_colormap: Prints the 256-lineindex R G Blookup table (0..255scaled to0..255per channel) to stdout and exits.
Algorithm
For each pixel across the three input bands, extracts the top 3 bits of Red ((R >> 5) << 5), the top 3 bits of Green ((G >> 5) << 2), and the top 2 bits of Blue (B >> 6), bitwise-ORing them into a single 8-bit [RRRGGGBB] pixel:
out = ((red >> 5) << 5) | ((green >> 5) << 2) | (blue >> 6);