hongfaqiu / TIFFImageryProvider

Load GeoTIFF/COG(Cloud optimized GeoTIFF) on Cesium
https://tiff-imagery-provider.opendde.com/?panel=layer
MIT License
52 stars 10 forks source link

"No data" areas show as solid black instead of transparent when using convertToRGB true or multi-band #19

Closed hillmb79 closed 11 months ago

hillmb79 commented 11 months ago

Great library! Struggling on one issue, I have a number of multi-band RGB TIFFs I'm trying to render but I can't seem to find a way to get the "empty" no data area to just be transparent so that the background shows through. Instead, it is always solid black - presumably because the RGB value across the bands is 0 / 0 / 0.

As an example, here's what I see using TIFFImageryProvider in Cesium: image

Here is what I see for the same image using QGIS which is setup by default to use "No Color" for the no data values, so these no data areas just display the layer beneath rather than solid black: image

If I change the QGIS No Data color to black, I get a result that looks like the TIFFImageryProvider in Cesium which is what makes me think TIFFImageryProvider must be using rgb(0,0,0) for the no data color:

image

Any help greatly appreciated! Thank you.

hongfaqiu commented 11 months ago

Done! You can now customize RGB colors using the colorMapping parameter in renderOptions. The default scheme is to only make black transparent.

hillmb79 commented 11 months ago

Just some feedback - this is working great now and I'm able to get the map looking the way I need to. Thanks for the quick update!

hongfaqiu commented 11 months ago

Thank you for your feedback. I'm glad to be able to assist you.