[gdal-dev] Applying colour/contrast corrections to geotiffs

Paul Norman penorman at mac.com
Mon Mar 11 10:55:55 PDT 2013

I am generating a geotiff from a WMS source. I can do so from either PNG
requests or JPEG requests. The PNG requests have better contrast but are
4x-5x as slow.

I would like to compare the PNG and JPEG request results for a
representative area and develop a contrast correction which I can apply to
the JPEG request result to make it look like the PNG request result, but I
am not certain how to do this. I can get histograms and stats with gdalinfo.
I was thinking perhaps developing a LUT correction which I could then apply,
but I'm not sure how to match the images or apply the correction.

Other potentially relevant information

- The total image size is going to be 350GB-500GB, in a few slices

- The WMS server owners are okay with me scraping this, but won't give me
the original imagery file

- I will be eventually compressing the imagery as JPEG in TIFF

- The result will be used by mapserver, then sliced and served as TMS images
by mapproxy. If all else fails I can apply a LUT in mapserver.

- Screenshots of the jpeg request results vs. png request results are at
http://took.paulnorman.ca/images/databc_differences.png. The differences are
minimal, but I'd like to do this right

I'm after any suggestions for how to derive the adjustments needed as well
as how to apply them.


Paul Norman

More information about the gdal-dev mailing list