hmm icon indicating copy to clipboard operation
hmm copied to clipboard

support float32 images

Open AndrewAnnex opened this issue 5 years ago • 5 comments

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...

AndrewAnnex avatar Dec 10 '19 23:12 AndrewAnnex

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 avatar Dec 11 '19 02:12 fogleman

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 avatar Dec 11 '19 02:12 fogleman

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

fogleman avatar Dec 11 '19 02:12 fogleman

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.

tplc10 avatar Jul 29 '20 01:07 tplc10

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

kylebarron avatar Dec 07 '20 21:12 kylebarron