-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot make colours fully not visible #41
Comments
I believe that the TIFF format does not support the opacity channel. Other formats do (e.g. HFA, KEA), but I don't think TIFF does. Anyway, apart from that, the best way to make null values invisible is to set the null value of the file. Then your display software (e.g. QGIS) will not display those pixels at all. There are many ways to set the null value, depending on how you are creating the file. If you are using RIOS to create the output file, you can set this in the controls for the calculation, with something like this
Or, if you have created the file some other way, RIOS can do it using the calcstats module. Or, finally, you can do it directly using GDAL from Python, using the Band.SetNoDataValue() method. |
re: UINT16. Do you mean the datatype of the raster? This depends on the raster format, but with TIFF, you should be fine with either UINT8 or UINT16, and probably also UINT32. re: labels. This also depends on the format. TIFF does not really support labels like this, but GDAL's (optional) PAM extensions do provide some support. This will be stored in a separate file with suffix .aux.xml, assuming that the GDAL you are using has this feature turned on. Whether the display software you are using will notice them is a separate problem. |
re: uint16 and tif. I'd just be a bit careful with this, the result tends to be extremely slow to read with QGIS, Arc etc. Problem is that the tif standard requres 65535 entries for uint16 files in the colour table even if you only write a few. The software reading the file will not know that most of these entries are blank and will take a long time to read the lot in. The other formats mentioned (HFA, KEA) do not have this limitation. As a bonus, they properly support RATs so you can write additional columns and have them stored in the file (whether you can see these depends on the software you use for reading). |
Good afternoon,
I have one question and I hope You are going to find some time to help me.
I have a file:
pixel values from 0 to 6 (at the moment)
All I want to do is to give colours for classified areas. For example, I want to colour all pixels with values 1 to blue. On the other hand, pixel with value 0 is no data pixels, and I do not want to colour them, I want to make when fully invisible. My demo code:
Result:
Maybe I do something wrong? I hope to get your answer. Thank You!
The text was updated successfully, but these errors were encountered: