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

image.readRasters() #404

Open
pChao3 opened this issue Nov 10, 2023 · 3 comments
Open

image.readRasters() #404

pChao3 opened this issue Nov 10, 2023 · 3 comments

Comments

@pChao3
Copy link

pChao3 commented Nov 10, 2023

i use this api, but the res is [2268,2910,2112,1850,...]
i need help..

@constantinius
Copy link
Member

With that little detail it is hard to see what you try to achieve, how you go about it and where you need help. Please provide more details, otherwise I'll have to close this issue.

@pChao3
Copy link
Author

pChao3 commented Nov 12, 2023

I apologize for the previous incomplete information. The issue I'm encountering is that the image.readRasters() method returns an array structured as Uint16Array, with four-digit values. I aim to obtain a Uint8Array structured array, containing values within the range of 0 to 255. Upon reviewing relevant documentation, it seems there's no mention of any parameters within the API to modify the structure of the returned array. Hence, I wanted to ask if this API allows for parameter adjustment to change the structure of the returned array?

@constantinius
Copy link
Member

It looks like you want to get RGB data from the TIFF. If that is correct, please use the readRGB method instead.

readRasters will always return the "actual" data, which may be in any value space or datatype the underlying TIFF provides. You have to adjust the result accordingly for your usecase.

Again, this is very little information. The library seems to perform as expected and the results are according to the capabilities and documentation.

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