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

How to solve ”Some tiffs are not int16 Gray images ? #41

Closed
KnowAndPerform opened this issue Oct 30, 2020 · 3 comments
Closed

How to solve ”Some tiffs are not int16 Gray images ? #41

KnowAndPerform opened this issue Oct 30, 2020 · 3 comments

Comments

@KnowAndPerform
Copy link

Hello,
My tiff files are int24 Gray images. These tiff files must translate into 8 bit gray images? Why only int8 gray images can display by your method?
Could I change the source code to convert the 24-bit topographic map directly to the 8-bit topographic map? Because I see your code can only transferre int16 gray images.
If can not , cloud you provide a good idea?
Thanks.

@kaktus40
Copy link
Owner

Hello,
The main questions are:

  • what is the precision of the data in elevation (generally it's 1 meter) ? => the answer defines the precision of gray (int16, int32, int8, int24) needed and also the number format (int, float).
  • What is the organization of your data: Your int24 is he really a band of int on 3 bytes or is it 3 bands of one byte colors? How can you convert your data to elevation? => define the function to use for conversion . See here or here

@KnowAndPerform
Copy link
Author

KnowAndPerform commented Nov 2, 2020

Hello,
Thanks for your responses,I have some questions:

  1. If the precision of my elevation data is 1 meter, do I need int8 gray (the number of bits per pixel is 8)? Else if 0.3 meter, I need int32 and the number format is float? But what is the precision of the data in elevation, I need int16 or int 24?

  2. My int24 may be 3 bands of one byte colors.
    image

  3. I need define the function to convert int24 to int16 and then use your java code to convert int16 to int8? Or by modifying your code, directly convert int24 to int8?(Where do I need to modify?)

Looking forward to your reply, thank you!

@kaktus40
Copy link
Owner

kaktus40 commented Nov 2, 2020

If your data have a precision of 0.3 meter, I suggest to convert your geotiff band to float32 gray.

If you have access to geoserver, you just need to install the bil/dds plugin and your geoserver will gain the capability to interpret directly the float32 gray band with gdal! Just follow my comment in the previous link

@kaktus40 kaktus40 closed this as completed Apr 3, 2022
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