diff --git a/pyqtgraph/functions.py b/pyqtgraph/functions.py index b1934d0a..2930b0e7 100644 --- a/pyqtgraph/functions.py +++ b/pyqtgraph/functions.py @@ -875,6 +875,9 @@ def makeARGB(data, lut=None, levels=None, scale=None, useRGBA=False): order = [2,1,0,3] ## for some reason, the colors line up as BGR in the final image. if data.ndim == 2: + # This is tempting: + # imgData[..., :3] = data[..., np.newaxis] + # ..but it turns out this is faster: for i in range(3): imgData[..., i] = data elif data.shape[2] == 1: diff --git a/pyqtgraph/graphicsItems/ImageItem.py b/pyqtgraph/graphicsItems/ImageItem.py index 530db7fb..82807982 100644 --- a/pyqtgraph/graphicsItems/ImageItem.py +++ b/pyqtgraph/graphicsItems/ImageItem.py @@ -260,8 +260,8 @@ class ImageItem(GraphicsObject): #print lut.shape #print self.lut - argb, alpha = fn.makeARGB(self.image, lut=lut, levels=self.levels) - self.qimage = fn.makeQImage(argb, alpha) + argb, alpha = fn.makeARGB(self.image.T, lut=lut, levels=self.levels) + self.qimage = fn.makeQImage(argb, alpha, transpose=False) prof.finish()