RGB2PCT

Compress Image using PCT


EnvironmentsPYTHON :: EASI :: MODELER
Batch ModeYes
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Related

Back to top

Description


Takes a 24-bit RGB image and compresses it into a single 8-bit image, based on a defined Pseudocolor Table (PCT). For each pixel in the input image, this function establishes the nearest color in the supplied PCT, and places a corresponding color index in the output channel. This capability is useful when exporting color images for hardware/software systems that do not support 24-bit color.
Back to top

Parameters


Name Type Length Value range
InputFile: Input raster channel(s) or layer(s) * Raster port 3 - 3  
OutputFile: Output raster channel(s) or layer(s) * Raster port 1 - 1 1 - 1024
InputPCT: Pseudocolor Layer * PCT port 1 - 1  

* Required parameter
Back to top

Parameter descriptions

InputFile: Input raster channel(s) or layer(s)

Specifies the three 8-bit channels in the RGB image.

OutputFile: Output raster channel(s) or layer(s)

Specifies the single 8-bit output channel in which to store the compressed image.

InputPCT: Pseudocolor Layer

Specifies the Pseudocolor Table (PCT) segment used to define the set of available colors to which the image should be compressed.

Back to top

Details

RGB2PCT compresses a 24-bit color (RGB) image into a single 8-bit channel based on the specified pseudocolor table (PCT, segment type: 171). The pseudocolor table is used to color the compressed image so that it looks similar to the original 24-bit color image. This capability is useful when preparing color images for export to other third-party software systems with limited color capability.

The input file (FILE) contains the input RGB channels (DBIC) and the channel to which to write the compressed result (DBOC).

Due to the 8-bit nature of a pseudocolor table, the input RGB channels and the output compressed channel must be 8-bit. While any type of image channel may be used, values are internally converted to 8-bit data. Using non 8-bit data may result in unexpected or poor results.

Note: If the imagery is to be enhanced with an LUT, this should be applied to the RGB channels ahead of time using the LUT function.

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.