»

Technicality

· 10TH OF SEPTEMBER, THE YEAR 2004

CONVERTING FROM RGB TO PSEUDOCOLOR

I finally figured out how to convert from a three-band RGB image to pseudocolor: GDAL! GDAL actually ships with a little Python script called rgb2pct.py that does just this. So far I’ve only tried it with GeoTIFFs, but I assume it’ll work with any format GDAL can write to. Now if only I could convince Chameleon to display TIFFs…

And now, here’s how you do it in Erads IMAGINE (8.7):

  1. Open the RGB image in a new viewer with no stretch, goto Raster/Contrast/Breakpoints… and click on Apply All. Save the image. This is necessary because if you don’t save the breakpoints under an unstretched histogram, IMAGINE will automatically operate on a stretched version of the image later on.
  2. Open Interpreter/Utilities/Adv. RGB Clustering… Select your Input File, click Load Image Data.
  3. Under the Partition Data tab, click Optimize for a threshold of 256 classes, which will give you a 256 color 8-bit image. Click Build LUT.
  4. Under the Image I/O tab agian, select an Output Image File, and click Produce Output.

Note quite as simple as the GDAL command-line tool, but it produces a smoother, undithered image, and it might be less intimidating for the exclusively GUI oriented. Many thanks to the folks on the imagine_lps-l list that helped me out.

NO COMMENTS YET

Comments are closed.