How to define a new color palette(*.cpd file)?

I was trying to repeat the processing steps in tutorial (http://seom.esa.int/cryotraining2016/files/S1_ice_speed_practical_v2.0.pdf) when stuck on page 54. Please see the following screenshot——I could not download the color palette file ‘Ice_velocity.cpd’ used in the tutorial.
Finding the default *.cpd file in installing path of C:\Users\lt.snap\auxdata\color_palettes, I try to define another one by texting.
However, the real problem is how to define the transparent part of color ramp(inside the blue circle in the screenshot)? Actually, I find no information concerning the defining rules for *.cpd text file in SNAP help

By the way, it already been raised as the suggestion in latter version by @FedericoF in Suggestions to improve SNAP. I also think SNAP can support *.cpt file as color palette, which is more commonly used in cartography community.

If you look at the default color palette for offset tracking, you’ll notice the first color color0 has 4 values (instead of 3). The first (or the last) may represent the transparency. Maybe try to play with it ?

#BEAM Colour Palette Definition File
#Mon Mar 26 09:00:58 CEST 2018
autoDistribute=true
color0=0,0,0,0
color10=255,140,0
color11=255,0,0
color1=66,0,209
color2=0,0,255
color3=0,110,255
color4=0,255,255
color5=0,255,178
color6=0,255,89
color7=0,255,0
color8=165,255,0
color9=255,255,0
numPoints=12
sample0=-0.003300604716059752
sample10=0.8045764920120396
sample11=0.8718995834060479
sample1=0.1986686694659651
sample2=0.2659917608599734
sample3=0.33331485225398166
sample4=0.40063794364798994
sample5=0.4679610350419982
sample6=0.5352841264360065
sample7=0.6026072178300148
sample8=0.6699303092240231
sample9=0.7372534006180314

Thank you @qglaude, I will explore it. Other specification in detail?

The 4th value is the alpha. it can be omitted if the value should be opaque.

and the sampleX is the changing step in scale [0, 255] for the corresponding color? Right?

sampleX is is exact pixel value which corresponds to the colorX

1 Like