Skip to content

Commit

Permalink
added support for input images with float datatype
Browse files Browse the repository at this point in the history
  • Loading branch information
VaasuDevanS committed May 25, 2020
1 parent d8a3f3f commit 05e82db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rio_hist/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def reshape_as_raster(arr):
def cs_forward(arr, cs='rgb'):
""" RGB (any dtype) to whatevs
"""
arrnorm_raw = arr.astype('float64') / np.iinfo(arr.dtype).max
info = np.finfo if 'f' in arr.dtype.str else np.iinfo
arrnorm_raw = arr.astype('float64') / info(arr.dtype).max
arrnorm = arrnorm_raw[0:3]
cs = cs.lower()
if cs == 'rgb':
Expand Down

0 comments on commit 05e82db

Please sign in to comment.