[Gdal-dev] LUT colour correction to GDAL

Frank Warmerdam warmerdam at pobox.com
Tue Aug 21 08:34:42 EDT 2007


Rahkonen Jukka wrote:
> What I might want to do is to colour correct the original images by
> creating just external LUT tables for them in text format. Next I would
> like to mosaic the original images directly to the final, colour
> corrected target file with just nominal computional extra cost by
> runnign them through gdalwarp with '-wo LUT_COLOR_CORRECTION=YES' option
> set :)
> 
> In my case I could create LUT tables manually. Perhaps some clever
> programmer could even integrate the creation on LUT tables for usual
> tasks, like linear or standard deviation stretch, into some program that
> counts histograms?  For more sophisticated adjustments an external tool
> like GIMP showing preview of the result would be nice.

Jukka,

The gdalenhance can scale and apply a LUT.  It supports a LUT configuration
file that looks like this:

1:Band -0.5:ScaleMin 255.5:ScaleMax 0 0 0 0 0 0 0 0 2 4 4 4 ... 255

I have attached the literal config file example.  The config file may
contain multiple bands (each on their own line) though this example is
for a single band.  It can be applied like:

  gdalenhance -config x.config -ot Byte in.tif out.tif

The gdalenhance utility currently only exists in GDAL trunk (aka 1.5)
and is far from doing everything I had intended for it.  But with some
scripting to prepare the LUTs it should be suitable to preprocess your
imagery.

I'm not too inclined to incorporate application of LUT files in gdalwarp.

I would also like to mention that GRASS includes a variety of tools for this
sort of application.  And that OSSIM also apparently includes an excellent
color balancing and mosaicing capability that might be ideal for this sort of
use though I don't have personal experience with it.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org

-------------- next part --------------
1:Band -0.5:ScaleMin 255.5:ScaleMax 0 0 0 0 0 0 0 0 2 4 4 4 4 4 4 4 8 11 11 11 11 11 11 11 11 16 20 20 20 20 20 20 20 25 29 29 29 29 29 29 29 34 38 38 38 38 38 38 38 43 48 48 48 48 48 48 48 48 54 60 60 60 60 60 60 60 66 73 73 73 73 73 73 73 80 88 88 88 88 88 88 88 95 102 102 102 102 102 102 102 109 116 116 116 116 116 116 116 116 124 132 132 132 132 132 132 132 140 148 148 148 148 148 148 148 155 162 162 162 162 162 162 162 169 176 176 176 176 176 176 176 176 182 188 188 188 188 188 188 188 194 200 200 200 200 200 200 200 205 210 210 210 210 210 210 210 214 219 219 219 219 219 219 219 219 222 226 226 226 226 226 226 226 229 232 232 232 232 232 232 232 234 237 237 237 237 237 237 237 239 241 241 241 241 241 241 241 242 244 244 244 244 244 244 244 244 246 247 247 247 247 247 247 247 248 249 249 249 249 249 249 249 250 251 251 251 251 251 251 251 252 253 253 253 253 253 253 253 253 254 254 254 254 254 254 254 254 255 255 255 255 255 255 255 255 255 


More information about the Gdal-dev mailing list