Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions fastplotlib/graphics/features/_image.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from itertools import product
from math import ceil
from warnings import warn

import cmap as cmap_lib
import numpy as np
Expand Down Expand Up @@ -104,8 +105,11 @@ def _fix_data(self, data):
"it must be of shape [rows, cols], [rows, cols, 3] or [rows, cols, 4]"
)

# let's just cast to float32 always
return data.astype(np.float32)
if data.itemsize == 8:
warn(f"casting {array.dtype} array to float32")
return data.astype(np.float32)

return data

def __iter__(self):
self._iter = product(enumerate(self.row_indices), enumerate(self.col_indices))
Expand Down