CLR

Clear image channels


EnvironmentsPYTHON :: EASI
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Examples :: Related

Back to top

Description


CLR clears (overwrites) image channels by using specified gray values.
Back to top

Parameters


clr(file, dboc, valu, dbow)

Name Type Caption Length Value range
FILE * str Input file name 1 -    
DBOC * List[int] 1 1 -    
VALU * List[float] Gray-level values 1 -    
DBOW List[int] Raster output window 0 - 4 Xoffset, Yoffset, Xsize, Ysize

* Required parameter
Back to top

Parameter descriptions

FILE

The name of the PCIDSK file containing the channels to clear.

DBOC

The output channels to clear.

Note: You cannot specify duplicate channels.

VALU

Lists the gray-level values to write to each output channel.

The number of values must be less than or equal to the number of channels in the expanded output channel list (DBOC). Each channel in the expanded output channel list is cleared using the corresponding value in this parameter.

If the number of values is less than the number of channels, the last value in the value list is used to clear the remaining channels in the expanded output channel list.

Acceptable gray-level values depend on the data type of the channel, listed as follows:

DBOW

The raster window (x-offset, y-offset, x-size, y-size) to clear. If no value is specified for DBOW, the entire layer is processed as output by default. X-offset and y-offset define the upper-left starting pixel coordinates of the window. X-size is the number of pixels that define the window width. Y-size is the number of lines that define the window height.

Back to top

Details

CLR overwrites (clears) all of the pixels in the specified image channels (DBOC) of an input image file (FILE) using defined gray-level values (VALU). Output channels can be set to different specified values.

Clearing occurs under the specified database output window (DBOW); by default, the entire channel is processed.

Back to top

Examples

Clear channel 2 with the gray-level value 0, and channel 5 with the gray-level value 255.

from pci.clr import clr

file = "testfile.pix"
dboc =  [2,5]
valu =  [0,255]
dbow =  []

clr( file, dboc, valu, dbow )

Clear the first 1024 image channels in the testfile.pix file in the upper-left 128 x 128 window, by setting all pixel gray-level values to zero.

from pci.clr import clr

file = "testfile.pix"
dboc = list(range(1, 1024 + 1))
valu =  [0]
dbow =  [0,0,128,128]

clr( file, dboc, valu, dbow )

Clear the first six output channels to different gray-level values, and clear the remaining four output channels in the list to zero.

from pci.clr import clr

file = "testfile.pix"
dboc = list(range(1, 10 + 1))
valu = [1,2,3,4,5,6,0]
dbow = []

clr( file, dboc, valu, dbow )

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