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

support float32 images #11

Open
AndrewAnnex opened this issue Dec 10, 2019 · 5 comments
Open

support float32 images #11

AndrewAnnex opened this issue Dec 10, 2019 · 5 comments

Comments

@AndrewAnnex
Copy link

would it be possible to support float32 input files, like geotiffs, without conversion into a 8bit image format first? Totally understandable if additional dependencies are not desired. I am sure a short python/bash script could automate the conversion and correct zscale...

@fogleman
Copy link
Owner

hmm does load as 16-bit, not 8-bit: https://github.com/fogleman/hmm/blob/master/src/heightmap.cpp#L19

To get 32-bits would require extra effort.

@fogleman
Copy link
Owner

You might need to convert to a 16-bit PNG first, not sure.

https://github.com/fogleman/hmm/blob/master/src/stb_image.h#L7356

@fogleman
Copy link
Owner

Yeah looks like the image loader I'm using supports 16-bit PNGs and PSDs:

https://github.com/fogleman/hmm/blob/master/src/stb_image.h#L7248-L7259

@tplc10
Copy link

tplc10 commented Jul 29, 2020

Could you point me towards a similar solution that supports 32-bit images? I've been looking for one, but I can't seem to find one that both supports high resolution heightmaps (8192x8192 is what I've been using) and 32 bit.

@kylebarron
Copy link

@tplc10 If you're ok with Python, I wrote Python bindings to hmm, and it accepts Numpy arrays of type float32 as input.

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