tuiview
tuiview copied to clipboard
4-band images with ColorInterp=Alpha are not transparent
I can't work out how to edit the Stretch settings so that a 4-band GeoTIFF where band4 ColorInterp=Alpha is transparent.
Or is transparency not supported?
Currently this is not supported - tuiview just currently uses the no data value (if set) to determine the alpha value (transparent when value is no data). I haven't come across data sets that use band4 for alpha in my work, but agree it would be nice to support. I'll look into this after the next release (unless you beat me to it!).
Thanks for the explanation. I've tried a 3-band image with NoData but still don't see any transparency. (Also, none of the 3 colour pickers NoData,Background,NaN seem to make any difference).
I'm familiar with Qt and GDAL and Python but not TuiView so can't quite understand how/where in the code this is handled. I can see references to alpha but don't understand why it's not working, nor how I might change it to use the alpha band.
So the nodata is set to a value that occurs in your image?
The default colour for nodata is set here: https://github.com/ubarsc/tuiview/blob/master/tuiview/viewerstretch.py#L66. The nodata mask is created here: https://github.com/ubarsc/tuiview/blob/master/tuiview/viewerlayers.py#L926. The alpha is set here: https://github.com/ubarsc/tuiview/blob/master/tuiview/viewerLUT.py. It is complicated...
I've just done a test with showing a white image behind a raster that has black nodata around the edges. The white image (underneath) appears to show through where there is nodata:
PR #106 has implemented support for RGBA images to allow transparency to be read from band 4, thank you very much