Geoscience Reference
In-Depth Information
-of format
Format to be generated (defaults to GeoTIFF).
-b band
Band to convert to RGB, defaults to 1.
-rgba
Generate a RGBA file (instead of a RGB file by default).
source_file
The input file.
dest_file
The output RGB file that will be created.
We can recreate an RGB image from the indexed color image we generated previ-
ously:
pct2rgb.py lena_ct.tif lena_ct_rgb.tif
However, the median cut algorithm is a lossy compression that does not allow to
revert the last operation to create the previous image. This can be checked by calcu-
lating the checksums for the respective images using gdalinfo -checksum .
gdalinfo -checksum lena_rgb.tif
...
Band 1 Block=512x5 Type=Byte, ColorInterp=Red
Checksum=24719
Band 2 Block=512x5 Type=Byte, ColorInterp=Green
Checksum=42748
Band 3 Block=512x5 Type=Byte, ColorInterp=Blue
Checksum=44970
gdalinfo -checksum lena_ct_rgb.tif
...
Band 1 Block=512x5 Type=Byte, ColorInterp=Red
Checksum=47394
Band 2 Block=512x5 Type=Byte, ColorInterp=Green
Checksum=6721
Band 3 Block=512x5 Type=Byte, ColorInterp=Blue
Checksum=42478
 
Search WWH ::




Custom Search