GMT.jl lelandshade() ignores transparency option when cpt is used

When using lelandshade(), the transparency option works as expected without a cpt, as soon as I specify a cpt, it is always 100% traditional hill shading. What am I doing wrong?

t.zip (115.0 KB) includes t.grd and t.cpt

using GMT
G = gmtread("t.grd");
lelandshade(G, detail=0.045, contrast=6.0, zfactor=10, transparency=1.0, azimuth=215, elev=10, show=true)


Here, things work as expected. Only texture shading after Leland Brown, no traditional hill shading as transparency=1.0.

Now trying the same command but add a cpt with cmap="t.cpt" for some colouring:

lelandshade(G, detail=0.045, contrast=6.0, zfactor=10, transparency=1.0, azimuth=215, elev=10, cmap="t.cpt", show=true)


Here things are strange. It looks like 100% traditional hill shading even with transparency=1.0. I expected a result similar to the first greyscale image but in color and without the illumination from south-west shown here.

As a control the same as above but now with transparency=0.0.

lelandshade(G, detail=0.045, contrast=6.0, zfactor=10, transparency=0.0, azimuth=215, elev=10, cmap="t.cpt", show=true)


Interestingly I get the same result as before. If you subtract and viz() both images, they
are the same.

Apparently the transparency option has no function when cmap is used. What am I doing wrong here?

Will look later, but transparency has always been a permanent source of head-aches.

The color case was ignoring the user setting of transparency which resulted in defaulting to the transparency setting in blendimg! that is 0.5. So, color was always using a transparency=0.5

Fixed in master. I will release a new version soon (1.19) because LLVM in some Macs is screwing the use of the sprintf() function. This new version will also have some simple support to read/write laz format.

1 Like

Thank you for investigating, @Joaquim! Iā€™m looking forward to 1.19.

Should be out in ~1 hour

Works nicely now, thank you, @Joaquim!