Skip to content
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

Palette images not recognised #80

Open
howff opened this issue May 1, 2024 · 1 comment
Open

Palette images not recognised #80

howff opened this issue May 1, 2024 · 1 comment

Comments

@howff
Copy link
Contributor

howff commented May 1, 2024

I have a TIFF image with a palette but when I load it into tuiview it displays as greyscale, and says "no color table present"

Driver: GTiff/GeoTIFF
Files: no.tif
Size is 20000, 20000
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,20000.0)
Upper Right (20000.0,    0.0)
Lower Right (20000.0,20000.0)
Center      (10000.0,10000.0)
Band 1 Block=20000x48 Type=Byte, ColorInterp=Palette
  Color Table (RGB with 256 entries)
    0: 0,0,0,255
    1: 11,13,14,255
etc
@gillins
Copy link
Member

gillins commented May 2, 2024

TuiView currently only recognises colour tables written into the Raster Attribute Table. This is partly because tuiview was conceived as a tool for working with RATs, but also because the (older) colour table API is very slow to use from Python (have to read each row individually, not all at once like RATs).

So see if you can write the colour table to the RAT. You will also have to ensure the file is set to thematic (LAYER_TYPE=thematic in the band metadata or controls.setThematic(True) in RIOS).

If you feel strongly about this, I'm open to a PR to read the ColorTable if the RAT is missing - would be good if it didn't change the code around too much though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants