Select to view content in your preferred language

Geotiff alpha channel transparency

280
0
01-05-2023 12:50 AM
PatrickG
New Contributor

Hi,

How do you use the alpha channel from a geotiff in a raster function?

We've managed to load a Geotiff file as a raster, and after a bit of playing around we managed to get the nodata to not display as black using a Render mask:

private const string JsonFunction =
			@"{
		    ""raster_function"":{""type"":""Mask_function""},
		    ""raster_function_arguments"":
		    {
		        ""nodata_values"":{""double_array"":[0],""type"":""Raster_function_variable""},
		        ""nodata_interpretation"":{""nodata_interpretation"":""all"",""type"":""Raster_function_variable""},
		        ""raster"":{""name"":""raster"",""is_raster"":true,""type"":""Raster_function_variable""},
		        ""type"":""Raster_function_arguments""
		    },
		    ""type"":""Raster_function_template""}";


But, this still doesn't take account of the alpha channel, we need to modify the transparency of some of the pixels based on the alpha channel values. 
Is there anyone who can help?  

As a bonus, If anyone knows if there are different blending options for Raster overlays and how we would do that, that would also be great 😁

Cheers

0 Replies