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

16Bit can not display #12

Open
qtsun opened this issue Nov 19, 2018 · 8 comments
Open

16Bit can not display #12

qtsun opened this issue Nov 19, 2018 · 8 comments

Comments

@qtsun
Copy link

qtsun commented Nov 19, 2018

I found that cog-explorer can not display 16bit images ,it displayed black image

@constantinius
Copy link
Member

Hi @qtsun, thanks for reporting the issue!
Can you provide a URL for the image, so I can check this?

@qtsun
Copy link
Author

qtsun commented Nov 19, 2018

Hi @qtsun, thanks for reporting the issue!
Can you provide a URL for the image, so I can check this?

16bit images url
http://120.25.126.226:3000/LC8/qb_blouler_msi.tif
and Here is a 32bit single band image url
http://120.25.126.226:3000/LC8/test32bitSingleband.tif
Thanks for your reply !

@constantinius
Copy link
Member

Unfortunately I cannot load your files as they don't support HTTPS. Maybe you can put them somewhere where HTTPS is enabled?

Also, when I open them via GDAL I get the following error:

$ gdalinfo /vsicurl/http://120.25.126.226:3000/LC8/qb_blouler_msi.tif
Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.

This might be a hint why nothing is visible

@tushar10sh
Copy link

@qtsun You have to change the the getMaxValue function inside of webglrender.js and max value in toMathArray function inside of renderutils.js. The max value present by default is 65535. For 16 bit files with low dynamic range, scaling with 65535 will cause the image to appear black. Just change the max value in these two files to the approximate max value of the tiff files you are working with; and build the package with "npm run build".
@constantinius There is no issue with http/https . I have tried with both protocols and it works.

@constantinius
Copy link
Member

Regarding HTTPS I'm not so sure:

ERROR 11: CURL error: Failed to connect to 120.25.126.226 port 3000: Connection refused
gdalinfo failed - unable to open '/vsicurl/https://120.25.126.226:3000/LC8/qb_blouler_msi.tif'.

Yes, the default stretch used is to Uint16 max for Uint16 images. I have not yet implemented linear scaling, but it should be fairly easy to do.

@lnicola
Copy link

lnicola commented Sep 18, 2020

Hi! I have a different issue with 16-bit images:

image

This is after updating the renderer to return 4095 (a reasonable value for my TIFF) as the max value.

Sample file: https://nas.dend.ro/browse/public/cog.tif.

Scaling the image to 8-bit makes it show fine:

image

@constantinius
Copy link
Member

Hi @lnicola

Thanks for the update. Unfortunately I cannot bring the image you provided to load. Could you maybe set CORS headers for it?

@lnicola
Copy link

lnicola commented Sep 18, 2020

@constantinius sorry for the CORS issue, but it's not easy for me to set up the headers correctly (to handle OPTIONS, actually). You might need to download it locally.

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

4 participants