| Environments | PYTHON :: EASI :: MODELER |
| Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Example :: Related |
| Back to top |
| Back to top |
pctint(file, dbpct)
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| FILE * | str | Input file name | 1 - | |
| DBPCT * | List[int] | Pseudocolor table segment | 1 - 1 |
| Back to top |
FILE
Specifies the name of the PCIDSK image file containing the input pseudocolor table segment.
DBPCT
Specifies the pseudocolor table segment (type 121) that holds the pseudocolor table to be interpolated.
| Back to top |
PCTINT is used to interpolate non-zero color ranges in a pseudocolor table PCT segment between pre-initialized color values. All values to be interpolated should be black (0,0,0) before running PCTINT.
A typical use of PCTINT is to interpolate colors between known codings. For instance, specific colors might be attached to elevations of 10, 20, 30, and 40 meters, but with PCTINT it is possible to show gradual changes between these values.
A simple linear interpolation scheme is used to compute the new value of (0,0,0) PCT entries based on the previous and next non- zero color entry. If there are no previous and next colors, the (0,0,0) entries will not be replaced. Thus a range of zeros at the beginning or end of the table will remain zero.
Although pure black (0,0,0) values may not be used as a real color, it is possible to use near black (0,0,1) or (1,1,1) instead.
| Back to top |
The following example reads a text file (rgb.txt) containing three color values to interpolate among, and then runs PCTINT to fill in all the missing (0,0,0) values.
rgb.txt: 0 100 0 255 100 100 120 50 255 255 255 255
from pci.pctint import pctint
from pci.pctread import pctread
file='irvine.pix'
dbpct=[]
dbsn='Smooth'
dbsd=''
pctform='INOUT'
tfile='rgb.txt'
lasc=pctread(file, dbpct, dbsn, dbsd, pctform, tfile)
dbpct = [lasc] # Use segment created by PCTREAD
pctint (file,dbpct)
Input PCT: Output PCT:
0: 100 0 255 100 0 255
1: 0 0 0 100 1 253
2: 0 0 0 100 2 251
3: 0 0 0 100 4 249
... ...
98: 0 0 0 100 118 54
99: 0 0 0 100 119 52
100: 100 120 50 100 120 50
101: 0 0 0 101 120 51
102: 0 0 0 102 128 53
103: 0 0 0 103 120 54
... ...
253: 0 0 0 253 120 252
254: 0 0 0 254 120 254
255: 255 120 255 255 120 255
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.