[gdal-dev] Calibrating colors of a series of maps

Frank Warmerdam warmerdam at pobox.com
Sat Dec 26 11:51:11 EST 2009


Jan Hartmann wrote:
> Hi,
> 
> I put the following question on the GRASS user list. It isn't possible 
> with GRASS (or the programs mentioned by Glynn), but if someone on this 
> list can help me further, I would be very grateful. I have been 
> struggling for some time with this problem, and I'll have to process 
> lots of scanned old maps in the near future.

Jan,

The rgb2pct.py script can be used to downsample 24bit images to 8bit
paletted form.  I see it now supports providing a predefined palette.
It might be best to pick a representative map, and use it for the first
downsampling - restricting the number of colors with the -n flag - and
then use the resulting palette for the other maps.

If the discoloring is not too severe, and if you restrict the palette
to a very distinct set of colors, you might find this reduces things to
a sufficiently similar set of images.

Doh!  I just looked and rgb2pct.py always does dithering which means
it will end up using speckled pixels of the available colors to
try and approximate the original.  This will be quite unsuitable for
your purposes.

If you would like, I'd be willing to expose a non-dithered option in
rgb2pct.py which might be useful.

Note that if the discoloring is too severe some additional sorts of
image processing might be required to get a good result.

Best regards,

>> > I am working with series of old topographical maps, ranging from 10 to 
>> > 600 map sheets per map. Each sheet is discolored a bit from age. How can 
>> > I process a complete series in such a way that there are no differences 
>> > visible any more between map sheets? Preferably I would like to 
>> > downsample them to 8 bits color table, as the originals only have a 
>> > small set of colors. In other words: how do I calibrate set of maps to 
>> > the same optimal color table?
>>   
> This is probably better done with general image-processing software,
> e.g. pnmquant (from the Netpbm package) or "convert -colors ..." (from
> ImageMagick).
> 
> -- Glynn Clements <glynn at gclements.plus.com>
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


-- 
---------------------------------------+--------------------------------------
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    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list