[Qgis-user] Color table for raster map

Peter Ersts ersts at amnh.org
Mon Feb 2 10:28:06 PST 2009


Agustin,

Sorry for my delayed response.

The three color ramp types are, Exact, Discrete, and Interpolated. 
Interpolated is the type you are looking for, I has seriously considered 
changing it to linear.

If you have two entries in your color table 0 = black 10 = white.
0 ,0,0,0,255,Black
10,255,255,255,255, White

Exact will only shade pixel values 0 and 10, all other pixel values will 
be ignored.

Discrete is like a bin ( 0 <= pixel < 10 shade as white) so pixel value 
of 5 would he shaded as white ( 255, 255, 255, 255 )

Interpolated is basically a linear interpolation between two colors. In 
this example 5 would be shaded as ( 128, 128, 128, 255 ).  **note, 
currently the alpha value is always 255 for the interpolated color and 
should probably be marked as a bug.

-pete

Agustin Lobo wrote:
> Peter,
>
> What would be the equivalent rules for a continuous pseudocolor table
> (i.e., INTERPOLATION::LINEAR ?)
> Actually, do you have some standard pseudocolor tables (i.e., terrain
> colors) already made?
>
> Thanks
> Agus
>
> 2009/1/14 Peter Ersts <ersts at amnh.org>:
>   
>> The easies way is to make a text file (classification.txt) and add the color
>> entries by hand. So the contents of the file will look like:
>>
>> INTERPOLATION::EXACT
>> 11,0,0,255,255,Post-flooding or irrigated croplands (or aquatic)
>> 14,0,255,0,255,Rainfed croplands
>> 20,255,0,255,Mosaic cropland (50-70%) / vegetation
>> (grassland/shrubland/forest) (20-50%)
>>
>>
>> This will set pixels 11 to blue, 14 to green and 20 to red. The format is
>> really basic.
>> pixel value, red, green, blue, alpha, label (no commas)
>>
>> Then on the colormap tab, you can click the "Load color map from file"
>> button, second one from the top right.
>>
>> Eventually it is planned that it will be able to read a variety of different
>> colormap formats.
>>
>> -pete
>>
>> Agustin Lobo wrote:
>>     
>>> I've got a landcover map in raster format (a tif file)
>>> from GLOBOVER
>>> (http://postel.mediasfrance.org/en/BIOGEOPHYSICAL-PRODUCTS/Land-Cover/)
>>> The raster is opened in QGIS as "Single Band Grey"
>>> How can I set an arbitrary color table? I can see how
>>> to set a ramp, but this is a classified image, in which
>>> integer values stand for different types
>>> i,e,:
>>> 11    Post-flooding or irrigated croplands (or aquatic)
>>> 14    Rainfed croplands
>>> 20    Mosaic cropland (50-70%) / vegetation (grassland/shrubland/forest)
>>> (20-50%)
>>>
>>> for which different colors should be set as in "unique value"
>>> for vector maps.
>>>
>>> Thanks
>>>
>>> Agus
>>>       


-- 
====================================
Peter J. Ersts, Project Specialist
American Museum of Natural History
Center for Biodiversity and Conservation
Central Park West at 79th Street
New York, New York 10024
Tel: Home Office (518)-632-4745 or NYC Office (212)-496-3488
Web: http://biodiversityinformatics.amnh.org
Web: http://cbc.amnh.org

Quantum GIS Raster Development Team. Visit http://www.qgis.org
to learn more about QGIS, a free and open source desktop GIS

Open Source,
...evolving through community cooperation to change the world bit by bit




More information about the Qgis-user mailing list