diff --git a/gbdxtools/ipe/io.py b/gbdxtools/ipe/io.py
index <HASH>..<HASH> 100644
--- a/gbdxtools/ipe/io.py
+++ b/gbdxtools/ipe/io.py
@@ -1,6 +1,8 @@
 import rasterio
+import numpy as np
 
 def to_geotiff(arr, path='./output.tif', proj=None, dtype=None):
+    dtype = np.dtype(dtype)
     data = arr.read()
     c,h,w = data.shape
     meta = {
@@ -14,6 +16,7 @@ def to_geotiff(arr, path='./output.tif', proj=None, dtype=None):
         meta["crs"] = {'init': proj}
     with rasterio.open(path, "w", **meta) as dst:
         if dtype is not None:
+            data = (data - data.min()) * (float(np.iinfo(dtype).max) * data.max())
             data = data.astype(dtype)
         dst.write(data)
     return path
fixing to_geotif to support dtypes