Repository: pyqtgraph/pyqtgraph

Issue:
Some tests fail on s390x architecture
I have seen these failures for several years, but only today I realized they only seem to occur on s390x architecture.  This is probably not a big priority, but I figured I would report it anyway.

One possible clue is that s390x is big endian.

```
=================================== FAILURES ===================================
________________________________ test_ImageItem ________________________________

transpose = False

    def test_ImageItem(transpose=False):
    
        w = pg.GraphicsLayoutWidget()
        w.show()
        view = pg.ViewBox()
        w.setCentralWidget(view)
        w.resize(200, 200)
        img = TransposedImageItem(border=0.5, transpose=transpose)
    
        view.addItem(img)
    
        # test mono float
        np.random.seed(0)
        data = np.random.normal(size=(20, 20))
        dmax = data.max()
        data[:10, 1] = dmax + 10
        data[1, :10] = dmax + 12
        data[3, :10] = dmax + 13
        img.setImage(data)
    
        QtTest.QTest.qWaitForWindowExposed(w)
        time.sleep(0.1)
        app.processEvents()
>       assertImageApproved(w, 'imageitem/init', 'Init image item. View is auto-scaled, image axis 0 marked by 1 line, axis 1 is marked by 2 lines. Origin in bottom-left.')

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ImageItem.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:188: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        ...,
        [  0,  ...,
        ...,
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:276: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for imageitem/init ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff76e18a60>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[-1.414213562373095, 21.414213562373096], [-1.414213562373095, 21.414213562373096]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76e18af0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff76e18e50>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [8.76 0.00 0.00]
      [0.00 -8.76 0.00]
      [12.39 187.61 1.00]
        <pyqtgraph.tests.image_testing.TransposedImageItem object at 0x3ff76cef0d0>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 20.0, 20.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff772ce040>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff772ced30>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76e18dc0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


___________________________ test_ImageItem_axisorder ___________________________

    def test_ImageItem_axisorder():
        # All image tests pass again using the opposite axis order
        origMode = pg.getConfigOption('imageAxisOrder')
        altMode = 'row-major' if origMode == 'col-major' else 'col-major'
        pg.setConfigOptions(imageAxisOrder=altMode)
        try:
>           test_ImageItem(transpose=True)

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ImageItem.py:132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ImageItem.py:34: in test_ImageItem
    assertImageApproved(w, 'imageitem/init', 'Init image item. View is auto-scaled, image axis 0 marked by 1 line, axis 1 is marked by 2 lines. Origin in bottom-left.')
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:188: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        ...,
        [  0,  ...,
        ...,
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:276: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for imageitem/init ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff772de160>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[-1.414213562373095, 21.414213562373096], [-1.414213562373095, 21.414213562373096]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff772e09d0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff772e0160>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [8.76 0.00 0.00]
      [0.00 -8.76 0.00]
      [12.39 187.61 1.00]
        <pyqtgraph.tests.image_testing.TransposedImageItem object at 0x3ff772d3940>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 20.0, 20.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff772e0550>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff772e0c10>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff772e0b80>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


___________________________ test_NonUniformImage_lut ___________________________

    def test_NonUniformImage_lut():
    
        window = pg.GraphicsLayoutWidget()
        viewbox = pg.ViewBox()
        window.setCentralWidget(viewbox)
        window.resize(200, 200)
        window.show()
    
        x = [1.0, 3.0, 10.0]
        y = [1.0, 2.0, 4.0]
        X, Y = np.meshgrid(x, y, indexing='ij')
        Z = X * Y
    
        image = NonUniformImage(x, y, Z, border=fn.mkPen('g'))
        viewbox.addItem(image)
    
        lut = pg.HistogramLUTItem()
        window.addItem(lut)
    
        image.setLookupTable(lut, autoLevel=True)
    
        h = image.getHistogram()
        lut.plot.setData(*h)
    
        QtTest.QTest.qWaitForWindowExposed(window)
        QtTest.QTest.qWait(100)
    
>       assertImageApproved(window, 'nonuniform_image/lut-3x3')

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_NonUniformImage.py:76: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:188: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        ...,
        [  0,  ...,
        ...,
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:276: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for nonuniform_image/lut-3x3 ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff76c5d310>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[0.36360389693210726, 10.636396103067893], [0.7878679656440357, 4.212132034355964]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c5d670>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff76c5d5e0>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [19.47 0.00 0.00]
      [0.00 -58.41 0.00]
      [-7.08 246.02 1.00]
        <pyqtgraph.graphicsItems.NonUniformImage.NonUniformImage object at 0x3ff76c590d0>
        bounding rect: PyQt5.QtCore.QRectF(1.0, 1.0, 9.0, 3.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c5d790>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c5d820>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c5d700>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


________________________ test_NonUniformImage_colormap _________________________

    def test_NonUniformImage_colormap():
    
        window = pg.GraphicsLayoutWidget()
        viewbox = pg.ViewBox()
        window.setCentralWidget(viewbox)
        window.resize(200, 200)
        window.show()
    
        x = [1.0, 3.0, 10.0]
        y = [1.0, 2.0, 4.0]
        X, Y = np.meshgrid(x, y, indexing='ij')
        Z = X * Y
    
        Z[:, 0] = [np.NINF, np.NAN, np.PINF]
    
        image = NonUniformImage(x, y, Z, border=fn.mkPen('g'))
    
        cmap = ColorMap(pos=[0.0, 1.0], color=[(0.0, 0.0, 0.0, 1.0), (1.0, 1.0, 1.0, 1.0)], mode='rgb')
        image.setColorMap(cmap)
    
        viewbox.addItem(image)
    
        QtTest.QTest.qWaitForWindowExposed(window)
        QtTest.QTest.qWait(100)
    
>       assertImageApproved(window, 'nonuniform_image/colormap-3x3')

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_NonUniformImage.py:104: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:188: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        ...,
        [  0,  ...,
        ...,
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:276: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for nonuniform_image/colormap-3x3 ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff76c46940>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[0.36360389693210726, 10.636396103067893], [0.7878679656440357, 4.212132034355964]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c468b0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff76c46820>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [19.47 0.00 0.00]
      [0.00 -58.41 0.00]
      [-7.08 246.02 1.00]
        <pyqtgraph.graphicsItems.NonUniformImage.NonUniformImage object at 0x3ff76c54310>
        bounding rect: PyQt5.QtCore.QRectF(1.0, 1.0, 9.0, 3.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c46af0>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c46b80>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c46a60>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


______________________________ test_PlotCurveItem ______________________________

    def test_PlotCurveItem():
        p = pg.GraphicsLayoutWidget()
        p.resize(200, 150)
        p.ci.setContentsMargins(4, 4, 4, 4)  # default margins vary by platform
        p.show()
        v = p.addViewBox()
        data = np.array([1,4,2,3,np.inf,5,7,6,-np.inf,8,10,9,np.nan,-1,-2,0])
        c = pg.PlotCurveItem(data)
        v.addItem(c)
        v.autoRange()
    
        # Check auto-range works. Some platform differences may be expected..
        checkRange = np.array([[-1.1457564053237301, 16.145756405323731], [-3.076811473165955, 11.076811473165955]])
        assert np.allclose(v.viewRange(), checkRange)
    
>       assertImageApproved(p, 'plotcurveitem/connectall', "Plot curve with all points connected.")

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_PlotCurveItem.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:188: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        ...,
        [  0,  ...,
        ...,
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 300, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:276: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for plotcurveitem/connectall ======
view size: 200x150
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <pyqtgraph.graphicsItems.GraphicsLayout.GraphicsLayout object at 0x3ff76c54940>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 150.0)
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff76c54820>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 192.0, 142.0)
    view range: [[-1.1457564053237301, 16.14575640532373], [-3.076811473165955, 11.076811473165955]]
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c54ca0>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 192.0, 142.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff76c54c10>
        bounding rect: PyQt5.QtCore.QRectF()
        transform:
          [11.10 0.00 0.00]
          [0.00 -10.03 0.00]
          [12.72 111.13 1.00]
            <pyqtgraph.graphicsItems.PlotCurveItem.PlotCurveItem object at 0x3ff76c72550>
            bounding rect: PyQt5.QtCore.QRectF(-0.06369040551921816, -2.0704890292087743, 15.127380811038437, 12.140978058417549)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c54dc0>
            bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c54e50>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c54d30>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 192.0, 142.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c724c0>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


_____________________________ test_getArrayRegion ______________________________

transpose = False

    def test_getArrayRegion(transpose=False):
        pr = pg.PolyLineROI([[0, 0], [27, 0], [0, 28]], closed=True)
        pr.setPos(1, 1)
        rois = [
            (pg.ROI([1, 1], [27, 28], pen='y'), 'baseroi'),
            (pg.RectROI([1, 1], [27, 28], pen='y'), 'rectroi'),
            (pg.EllipseROI([1, 1], [27, 28], pen='y'), 'ellipseroi'),
            (pr, 'polylineroi'),
        ]
        for roi, name in rois:
            # For some ROIs, resize should not be used.
            testResize = not isinstance(roi, pg.PolyLineROI)
    
            origMode = pg.getConfigOption('imageAxisOrder')
            try:
                if transpose:
                    pg.setConfigOptions(imageAxisOrder='row-major')
                    check_getArrayRegion(roi, 'roi/'+name, testResize, transpose=True)
                else:
                    pg.setConfigOptions(imageAxisOrder='col-major')
>                   check_getArrayRegion(roi, 'roi/'+name, testResize)

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ROI.py:33: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ROI.py:100: in check_getArrayRegion
    assertImageApproved(win, name+'/roi_getarrayregion', 'Simple ROI region selection.')
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:188: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        ...,
        [  0,  ...,
        ...,
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 800, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:276: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for roi/baseroi/roi_getarrayregion ======
view size: 200x400
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <PyQt5.QtWidgets.QGraphicsWidget object at 0x3ff76bd2700>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 400.0)
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff76bd5820>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
view range: [[-2.274291477622673, 29.274291477622675], [-2.0260088948187804, 30.02600889481878]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76bd3790>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff76bd3670>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [5.96 0.00 0.00]
      [0.00 -5.96 0.00]
      [13.55 178.93 1.00]
        <pyqtgraph.graphicsItems.ImageItem.ImageItem object at 0x3ff76bc10d0>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 27.0, 28.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76bd39d0>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76bd3af0>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76bd38b0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff76bf55e0>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
view range: [[-2.464394135939392, 32.464394135939386], [-2.243081276406507, 33.24308127640651]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76bf5670>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff76bf5700>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [5.38 0.00 0.00]
      [0.00 -5.38 0.00]
      [13.26 178.93 1.00]
        <pyqtgraph.graphicsItems.ImageItem.ImageItem object at 0x3ff76bc1040>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 30.0, 31.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <pyqtgraph.graphicsItems.ROI.ROI object at 0x3ff76bd5790>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 27.0, 28.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76bf5ee0>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76bf5e50>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76bf5f70>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


________________________ test_getArrayRegion_axisorder _________________________

    def test_getArrayRegion_axisorder():
>       test_getArrayRegion(transpose=True)

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ROI.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ROI.py:30: in test_getArrayRegion
    check_getArrayRegion(roi, 'roi/'+name, testResize, transpose=True)
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ROI.py:100: in check_getArrayRegion
    assertImageApproved(win, name+'/roi_getarrayregion', 'Simple ROI region selection.')
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:188: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        ...,
        [  0,  ...,
        ...,
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 800, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:276: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for roi/baseroi/roi_getarrayregion ======
view size: 200x400
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <PyQt5.QtWidgets.QGraphicsWidget object at 0x3ff76c73040>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 400.0)
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff76bd0670>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
view range: [[-2.274291477622673, 29.274291477622675], [-2.0260088948187804, 30.02600889481878]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76bd0820>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff76bd0790>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [5.96 0.00 0.00]
      [0.00 -5.96 0.00]
      [13.55 178.93 1.00]
        <pyqtgraph.graphicsItems.ImageItem.ImageItem object at 0x3ff769c10d0>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 27.0, 28.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76bd0940>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76bd09d0>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76bd08b0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff76c70f70>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
view range: [[-2.464394135939392, 32.464394135939386], [-2.243081276406507, 33.24308127640651]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c70dc0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff76c70e50>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [5.38 0.00 0.00]
      [0.00 -5.38 0.00]
      [13.26 178.93 1.00]
        <pyqtgraph.graphicsItems.ImageItem.ImageItem object at 0x3ff769c1040>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 30.0, 31.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <pyqtgraph.graphicsItems.ROI.ROI object at 0x3ff76c73550>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 27.0, 28.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c70ca0>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c70160>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76c70d30>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


_______________________________ test_PolyLineROI _______________________________

    def test_PolyLineROI():
        rois = [
            (pg.PolyLineROI([[0, 0], [10, 0], [0, 15]], closed=True, pen=0.3), 'closed'),
            (pg.PolyLineROI([[0, 0], [10, 0], [0, 15]], closed=False, pen=0.3), 'open')
        ]
    
        #plt = pg.plot()
        plt = pg.GraphicsView()
        plt.show()
        resizeWindow(plt, 200, 200)
        vb = pg.ViewBox()
        plt.scene().addItem(vb)
        vb.resize(200, 200)
        #plt.plotItem = pg.PlotItem()
        #plt.scene().addItem(plt.plotItem)
        #plt.plotItem.resize(200, 200)
    
    
        plt.scene().minDragTime = 0  # let us simulate mouse drags very quickly.
    
        # seemingly arbitrary requirements; might need longer wait time for some platforms..
        QtTest.QTest.qWaitForWindowExposed(plt)
        QtTest.QTest.qWait(100)
    
        for r, name in rois:
            vb.clear()
            vb.addItem(r)
            vb.autoRange()
            app.processEvents()
    
>           assertImageApproved(plt, 'roi/polylineroi/'+name+'_init', 'Init %s polyline.' % name)

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ROI.py:186: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:188: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        ...,
        [  0,  ...,
        ...,
        [  0,   0, 255,   0],
        [  0,   0, 255,   0],
        [  0,   0, 255,   0]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:276: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for roi/polylineroi/closed_init ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76be68b0>
bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]

<PyQt5.QtWidgets.QGraphicsWidget object at 0x3ff76be6a60>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff76ce6c10>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[-0.7071067811865475, 10.707106781186548], [-1.0606601717798212, 16.060660171779823]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76be6700>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff76ce6820>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [17.52 0.00 0.00]
      [0.00 -11.68 0.00]
      [12.39 187.61 1.00]
        <pyqtgraph.graphicsItems.ROI.PolyLineROI object at 0x3ff769c1e50>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 10.0, 15.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI._PolyLineSegment object at 0x3ff769c1af0>
            bounding rect: PyQt5.QtCore.QRectF(-0.9131370849898477, 0.0, 1.8262741699796954, 15.0)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI._PolyLineSegment object at 0x3ff769c1b80>
            bounding rect: PyQt5.QtCore.QRectF(0.0, -1.3697056274847716, 10.0, 2.7394112549695433)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI._PolyLineSegment object at 0x3ff769c1c10>
            bounding rect: PyQt5.QtCore.QRectF(-0.645685424949238, -0.9685281374238572, 11.291370849898478, 16.937056274847713)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI.Handle object at 0x3ff769c1160>
            bounding rect: PyQt5.QtCore.QRectF(-0.20177669529663686, -0.30266504294495655, 0.40355339059327383, 0.6053300858899108)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI.Handle object at 0x3ff769c15e0>
            bounding rect: PyQt5.QtCore.QRectF(-0.2017766952966364, -0.30266504294495655, 0.4035533905932738, 0.6053300858899108)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI.Handle object at 0x3ff769c18b0>
            bounding rect: PyQt5.QtCore.QRectF(-0.20177669529663686, -0.30266504294495533, 0.40355339059327383, 0.6053300858899109)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76be6040>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76be6790>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


=========================== short test summary info ============================
FAILED pyqtgraph/graphicsItems/tests/test_ImageItem.py::test_ImageItem - Asse...
FAILED pyqtgraph/graphicsItems/tests/test_ImageItem.py::test_ImageItem_axisorder
FAILED pyqtgraph/graphicsItems/tests/test_NonUniformImage.py::test_NonUniformImage_lut
FAILED pyqtgraph/graphicsItems/tests/test_NonUniformImage.py::test_NonUniformImage_colormap
FAILED pyqtgraph/graphicsItems/tests/test_PlotCurveItem.py::test_PlotCurveItem
FAILED pyqtgraph/graphicsItems/tests/test_ROI.py::test_getArrayRegion - Asser...
FAILED pyqtgraph/graphicsItems/tests/test_ROI.py::test_getArrayRegion_axisorder
FAILED pyqtgraph/graphicsItems/tests/test_ROI.py::test_PolyLineROI - Assertio...
====== 8 failed, 202 passed, 5 skipped, 1 deselected in 265.87s (0:04:25) ======
```


Discussion:
This line in functions.py::makeARGB()
```python
        order = [2,1,0,3] # for some reason, the colors line up as BGR in the final image.
```
is at least one part in pyqtgraph that ignores the fact that QImage.Format.Format_ARGB32 is endian-dependent.
@swt2c , are you able to test out #1672 to see if it helps for this issue?

I applied #1672 to 0.11.0 and retested.  Looks like that didn't fix anything and added a couple of new failures :(

```
+ xvfb-run -a py.test-3.9 -k 'not test_reload'
============================= test session starts ==============================
platform linux -- Python 3.9.2, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /builddir/build/BUILD/pyqtgraph-0.12.0
collected 215 items / 1 deselected / 1 skipped / 213 selected

examples/test_examples.py .............................sF.....F......... [ 21%]
...............s.........................                                [ 40%]
pyqtgraph/dockarea/tests/test_dock.py ...                                [ 42%]
pyqtgraph/dockarea/tests/test_dockarea.py .                              [ 42%]
pyqtgraph/exporters/tests/test_csv.py .                                  [ 42%]
pyqtgraph/exporters/tests/test_hdf5.py ...                               [ 44%]
pyqtgraph/exporters/tests/test_image.py .                                [ 44%]
pyqtgraph/exporters/tests/test_svg.py ..                                 [ 45%]
pyqtgraph/graphicsItems/PlotItem/tests/test_PlotItem.py .....            [ 48%]
pyqtgraph/graphicsItems/ViewBox/tests/test_ViewBox.py ..s                [ 49%]
pyqtgraph/graphicsItems/ViewBox/tests/test_ViewBoxZoom.py ........       [ 53%]
pyqtgraph/graphicsItems/tests/test_ArrowItem.py .                        [ 53%]
pyqtgraph/graphicsItems/tests/test_AxisItem.py ......                    [ 56%]
pyqtgraph/graphicsItems/tests/test_ErrorBarItem.py .                     [ 57%]
pyqtgraph/graphicsItems/tests/test_GraphicsItem.py ..                    [ 57%]
pyqtgraph/graphicsItems/tests/test_ImageItem.py FF.                      [ 59%]
pyqtgraph/graphicsItems/tests/test_InfiniteLine.py ..                    [ 60%]
pyqtgraph/graphicsItems/tests/test_LegendItem.py .                       [ 60%]
pyqtgraph/graphicsItems/tests/test_NonUniformImage.py ...FF              [ 63%]
pyqtgraph/graphicsItems/tests/test_PlotCurveItem.py .                    [ 63%]
pyqtgraph/graphicsItems/tests/test_PlotDataItem.py ......                [ 66%]
pyqtgraph/graphicsItems/tests/test_ROI.py FFF                            [ 67%]
pyqtgraph/graphicsItems/tests/test_ScatterPlotItem.py ..                 [ 68%]
pyqtgraph/graphicsItems/tests/test_TextItem.py .                         [ 69%]
pyqtgraph/imageview/tests/test_imageview.py .                            [ 69%]
pyqtgraph/parametertree/tests/test_Parameter.py ....                     [ 71%]
pyqtgraph/parametertree/tests/test_parametertypes.py ....                [ 73%]
pyqtgraph/tests/test_Vector.py ..                                        [ 74%]
pyqtgraph/tests/test_configparser.py ..                                  [ 75%]
pyqtgraph/tests/test_exit_crash.py s.                                    [ 76%]
pyqtgraph/tests/test_functions.py .....F...............                  [ 85%]
pyqtgraph/tests/test_qt.py ..                                            [ 86%]
pyqtgraph/tests/test_ref_cycles.py ...                                   [ 88%]
pyqtgraph/tests/test_signalproxy.py ....                                 [ 90%]
pyqtgraph/tests/test_srttransform3d.py .                                 [ 90%]
pyqtgraph/util/tests/test_lru_cache.py .                                 [ 91%]
pyqtgraph/widgets/tests/test_combobox.py .                               [ 91%]
pyqtgraph/widgets/tests/test_graphics_view.py .                          [ 92%]
pyqtgraph/widgets/tests/test_histogramlutwidget.py .                     [ 92%]
pyqtgraph/widgets/tests/test_spinbox.py ...............                  [ 99%]
pyqtgraph/widgets/tests/test_tablewidget.py .                            [100%]

=================================== FAILURES ===================================
___________________ testExamples[ HistogramLUT.py - PyQt5 ] ____________________

0

Python 3.9.2 (default, Feb 20 2021, 00:00:00) 
[GCC 11.0.0 20210210 (Red Hat 11.0.0-0)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
>>> 

Failed Histogram / lookup table Example Test Located in HistogramLUT.py 
----------------------------- Captured stdout call -----------------------------
Histogram / lookup table 
0

Python 3.9.2 (default, Feb 20 2021, 00:00:00) 
[GCC 11.0.0 20210210 (Red Hat 11.0.0-0)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
>>> 

_____________________ testExamples[ ImageView.py - PyQt5 ] _____________________


Python 3.9.2 (default, Feb 20 2021, 00:00:00) 
[GCC 11.0.0 20210210 (Red Hat 11.0.0-0)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3

Failed ImageView Example Test Located in ImageView.py 
----------------------------- Captured stdout call -----------------------------
ImageView 

Python 3.9.2 (default, Feb 20 2021, 00:00:00) 
[GCC 11.0.0 20210210 (Red Hat 11.0.0-0)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3

________________________________ test_ImageItem ________________________________

transpose = False

    def test_ImageItem(transpose=False):
    
        w = pg.GraphicsLayoutWidget()
        w.show()
        view = pg.ViewBox()
        w.setCentralWidget(view)
        w.resize(200, 200)
        img = TransposedImageItem(border=0.5, transpose=transpose)
    
        view.addItem(img)
    
        # test mono float
        np.random.seed(0)
        data = np.random.normal(size=(20, 20))
        dmax = data.max()
        data[:10, 1] = dmax + 10
        data[1, :10] = dmax + 12
        data[3, :10] = dmax + 13
        img.setImage(data)
    
        QtTest.QTest.qWaitForWindowExposed(w)
        time.sleep(0.1)
        app.processEvents()
        assertImageApproved(w, 'imageitem/init', 'Init image item. View is auto-scaled, image axis 0 marked by 1 line, axis 1 is marked by 2 lines. Origin in bottom-left.')
    
        # ..with colormap
        cmap = pg.ColorMap([0, 0.25, 0.75, 1], [[0, 0, 0, 255], [255, 0, 0, 255], [255, 255, 0, 255], [255, 255, 255, 255]])
        img.setLookupTable(cmap.getLookupTable())
        assertImageApproved(w, 'imageitem/lut', 'Set image LUT.')
    
        # ..and different levels
        img.setLevels([dmax+9, dmax+13])
        assertImageApproved(w, 'imageitem/levels1', 'Levels show only axis lines.')
    
        img.setLookupTable(None)
    
        # test mono int
        data = np.fromfunction(lambda x,y: x+y*10, (129, 128)).astype(np.int16)
        img.setImage(data)
        assertImageApproved(w, 'imageitem/gradient_mono_int', 'Mono int gradient.')
    
        img.setLevels([640, 641])
        assertImageApproved(w, 'imageitem/gradient_mono_int_levels', 'Mono int gradient w/ levels to isolate diagonal.')
    
        # test mono byte
        data = np.fromfunction(lambda x,y: x+y, (129, 128)).astype(np.ubyte)
        img.setImage(data)
        assertImageApproved(w, 'imageitem/gradient_mono_byte', 'Mono byte gradient.')
    
        img.setLevels([127, 128])
        assertImageApproved(w, 'imageitem/gradient_mono_byte_levels', 'Mono byte gradient w/ levels to isolate diagonal.')
    
        # test monochrome image
        data = np.zeros((10, 10), dtype='uint8')
        data[:5,:5] = 1
        data[5:,5:] = 1
        img.setImage(data)
        assertImageApproved(w, 'imageitem/monochrome', 'Ubyte image with only 0,1 values.')
    
        # test bool
        data = data.astype(bool)
        img.setImage(data)
        assertImageApproved(w, 'imageitem/bool', 'Boolean mask.')
    
        # test RGBA byte
        data = np.zeros((100, 100, 4), dtype='ubyte')
        data[..., 0] = np.linspace(0, 255, 100).reshape(100, 1)
        data[..., 1] = np.linspace(0, 255, 100).reshape(1, 100)
        data[..., 3] = 255
        img.setImage(data)
>       assertImageApproved(w, 'imageitem/gradient_rgba_byte', 'RGBA byte gradient.')

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ImageItem.py:81: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:185: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        ...,
        [  0,  ...,
        ...,
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:273: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for imageitem/gradient_rgba_byte ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff75c9ef70>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[-7.0710678118654755, 107.07106781186548], [-7.0710678118654755, 107.07106781186548]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76668700>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff766685e0>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [1.75 0.00 0.00]
      [0.00 -1.75 0.00]
      [12.39 187.61 1.00]
        <pyqtgraph.tests.image_testing.TransposedImageItem object at 0x3ff75cb4280>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 100.0, 100.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76668550>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76668a60>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff76668670>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
___________________________ test_ImageItem_axisorder ___________________________

    def test_ImageItem_axisorder():
        # All image tests pass again using the opposite axis order
        origMode = pg.getConfigOption('imageAxisOrder')
        altMode = 'row-major' if origMode == 'col-major' else 'col-major'
        pg.setConfigOptions(imageAxisOrder=altMode)
        try:
>           test_ImageItem(transpose=True)

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ImageItem.py:132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ImageItem.py:81: in test_ImageItem
    assertImageApproved(w, 'imageitem/gradient_rgba_byte', 'RGBA byte gradient.')
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:185: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        ...,
        [  0,  ...,
        ...,
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:273: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for imageitem/gradient_rgba_byte ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff75ff08b0>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[-7.0710678118654755, 107.07106781186548], [-7.0710678118654755, 107.07106781186548]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75ff0700>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff75ff0310>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [1.75 0.00 0.00]
      [0.00 -1.75 0.00]
      [12.39 187.61 1.00]
        <pyqtgraph.tests.image_testing.TransposedImageItem object at 0x3ff7615fb80>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 100.0, 100.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75ff0790>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75ff0040>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75ff04c0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py", line 1263, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
___________________________ test_NonUniformImage_lut ___________________________

    def test_NonUniformImage_lut():
    
        window = pg.GraphicsLayoutWidget()
        viewbox = pg.ViewBox()
        window.setCentralWidget(viewbox)
        window.resize(200, 200)
        window.show()
    
        x = [1.0, 3.0, 10.0]
        y = [1.0, 2.0, 4.0]
        X, Y = np.meshgrid(x, y, indexing='ij')
        Z = X * Y
    
        image = NonUniformImage(x, y, Z, border=fn.mkPen('g'))
        viewbox.addItem(image)
    
        lut = pg.HistogramLUTItem()
        window.addItem(lut)
    
        image.setLookupTable(lut, autoLevel=True)
    
        h = image.getHistogram()
        lut.plot.setData(*h)
    
        QtTest.QTest.qWaitForWindowExposed(window)
        QtTest.QTest.qWait(100)
    
>       assertImageApproved(window, 'nonuniform_image/lut-3x3')

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_NonUniformImage.py:76: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:185: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        ...,
        [  0,  ...,
        ...,
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:273: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for nonuniform_image/lut-3x3 ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff759564c0>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[0.36360389693210726, 10.636396103067893], [0.7878679656440357, 4.212132034355964]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75956550>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff75956670>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [19.47 0.00 0.00]
      [0.00 -58.41 0.00]
      [-7.08 246.02 1.00]
        <pyqtgraph.graphicsItems.NonUniformImage.NonUniformImage object at 0x3ff75964700>
        bounding rect: PyQt5.QtCore.QRectF(1.0, 1.0, 9.0, 3.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75956c10>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75956ca0>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff759565e0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


________________________ test_NonUniformImage_colormap _________________________

    def test_NonUniformImage_colormap():
    
        window = pg.GraphicsLayoutWidget()
        viewbox = pg.ViewBox()
        window.setCentralWidget(viewbox)
        window.resize(200, 200)
        window.show()
    
        x = [1.0, 3.0, 10.0]
        y = [1.0, 2.0, 4.0]
        X, Y = np.meshgrid(x, y, indexing='ij')
        Z = X * Y
    
        Z[:, 0] = [np.NINF, np.NAN, np.PINF]
    
        image = NonUniformImage(x, y, Z, border=fn.mkPen('g'))
    
        cmap = ColorMap(pos=[0.0, 1.0], color=[(0.0, 0.0, 0.0, 1.0), (1.0, 1.0, 1.0, 1.0)], mode='rgb')
        image.setColorMap(cmap)
    
        viewbox.addItem(image)
    
        QtTest.QTest.qWaitForWindowExposed(window)
        QtTest.QTest.qWait(100)
    
>       assertImageApproved(window, 'nonuniform_image/colormap-3x3')

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_NonUniformImage.py:104: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:185: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        ...,
        [  0,  ...,
        ...,
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:273: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for nonuniform_image/colormap-3x3 ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff75971dc0>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[0.36360389693210726, 10.636396103067893], [0.7878679656440357, 4.212132034355964]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75979160>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff759790d0>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [19.47 0.00 0.00]
      [0.00 -58.41 0.00]
      [-7.08 246.02 1.00]
        <pyqtgraph.graphicsItems.NonUniformImage.NonUniformImage object at 0x3ff7597e940>
        bounding rect: PyQt5.QtCore.QRectF(1.0, 1.0, 9.0, 3.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75979280>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75979310>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff759791f0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


_____________________________ test_getArrayRegion ______________________________

transpose = False

    def test_getArrayRegion(transpose=False):
        pr = pg.PolyLineROI([[0, 0], [27, 0], [0, 28]], closed=True)
        pr.setPos(1, 1)
        rois = [
            (pg.ROI([1, 1], [27, 28], pen='y'), 'baseroi'),
            (pg.RectROI([1, 1], [27, 28], pen='y'), 'rectroi'),
            (pg.EllipseROI([1, 1], [27, 28], pen='y'), 'ellipseroi'),
            (pr, 'polylineroi'),
        ]
        for roi, name in rois:
            # For some ROIs, resize should not be used.
            testResize = not isinstance(roi, pg.PolyLineROI)
    
            origMode = pg.getConfigOption('imageAxisOrder')
            try:
                if transpose:
                    pg.setConfigOptions(imageAxisOrder='row-major')
                    check_getArrayRegion(roi, 'roi/'+name, testResize, transpose=True)
                else:
                    pg.setConfigOptions(imageAxisOrder='col-major')
>                   check_getArrayRegion(roi, 'roi/'+name, testResize)

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ROI.py:33: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ROI.py:100: in check_getArrayRegion
    assertImageApproved(win, name+'/roi_getarrayregion', 'Simple ROI region selection.')
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:185: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        ...,
        [  0,  ...,
        ...,
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 800, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:273: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for roi/baseroi/roi_getarrayregion ======
view size: 200x400
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <PyQt5.QtWidgets.QGraphicsWidget object at 0x3ff75ada670>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 400.0)
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff75ad9550>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
view range: [[-2.274291477622673, 29.274291477622675], [-2.0260088948187804, 30.02600889481878]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75ad9af0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff75ad99d0>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [5.96 0.00 0.00]
      [0.00 -5.96 0.00]
      [13.55 178.93 1.00]
        <pyqtgraph.graphicsItems.ImageItem.ImageItem object at 0x3ff75af73a0>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 27.0, 28.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75ad91f0>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75ad9430>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75ad90d0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff75adf4c0>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
view range: [[-2.464394135939392, 32.464394135939386], [-2.243081276406507, 33.24308127640651]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75adf550>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff75adf5e0>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [5.38 0.00 0.00]
      [0.00 -5.38 0.00]
      [13.26 178.93 1.00]
        <pyqtgraph.graphicsItems.ImageItem.ImageItem object at 0x3ff75af7430>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 30.0, 31.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <pyqtgraph.graphicsItems.ROI.ROI object at 0x3ff75acc670>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 27.0, 28.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75adfee0>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75adfe50>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75adff70>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


________________________ test_getArrayRegion_axisorder _________________________

    def test_getArrayRegion_axisorder():
>       test_getArrayRegion(transpose=True)

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ROI.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ROI.py:30: in test_getArrayRegion
    check_getArrayRegion(roi, 'roi/'+name, testResize, transpose=True)
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ROI.py:100: in check_getArrayRegion
    assertImageApproved(win, name+'/roi_getarrayregion', 'Simple ROI region selection.')
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:185: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        ...,
        [  0,  ...,
        ...,
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 800, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:273: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for roi/baseroi/roi_getarrayregion ======
view size: 200x400
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <PyQt5.QtWidgets.QGraphicsWidget object at 0x3ff75ada310>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 400.0)
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff758469d0>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
view range: [[-2.274291477622673, 29.274291477622675], [-2.0260088948187804, 30.02600889481878]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75846b80>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff75846af0>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [5.96 0.00 0.00]
      [0.00 -5.96 0.00]
      [13.55 178.93 1.00]
        <pyqtgraph.graphicsItems.ImageItem.ImageItem object at 0x3ff75852430>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 27.0, 28.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75846ca0>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75846d30>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75846c10>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff75874040>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
view range: [[-2.464394135939392, 32.464394135939386], [-2.243081276406507, 33.24308127640651]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff758741f0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff75874160>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [5.38 0.00 0.00]
      [0.00 -5.38 0.00]
      [13.26 178.93 1.00]
        <pyqtgraph.graphicsItems.ImageItem.ImageItem object at 0x3ff758523a0>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 30.0, 31.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <pyqtgraph.graphicsItems.ROI.ROI object at 0x3ff75adad30>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 27.0, 28.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75874310>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff758743a0>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff75874280>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


_______________________________ test_PolyLineROI _______________________________

    def test_PolyLineROI():
        rois = [
            (pg.PolyLineROI([[0, 0], [10, 0], [0, 15]], closed=True, pen=0.3), 'closed'),
            (pg.PolyLineROI([[0, 0], [10, 0], [0, 15]], closed=False, pen=0.3), 'open')
        ]
    
        #plt = pg.plot()
        plt = pg.GraphicsView()
        plt.show()
        resizeWindow(plt, 200, 200)
        vb = pg.ViewBox()
        plt.scene().addItem(vb)
        vb.resize(200, 200)
        #plt.plotItem = pg.PlotItem()
        #plt.scene().addItem(plt.plotItem)
        #plt.plotItem.resize(200, 200)
    
    
        plt.scene().minDragTime = 0  # let us simulate mouse drags very quickly.
    
        # seemingly arbitrary requirements; might need longer wait time for some platforms..
        QtTest.QTest.qWaitForWindowExposed(plt)
        QtTest.QTest.qWait(100)
    
        for r, name in rois:
            vb.clear()
            vb.addItem(r)
            vb.autoRange()
            app.processEvents()
    
            assertImageApproved(plt, 'roi/polylineroi/'+name+'_init', 'Init %s polyline.' % name)
            initState = r.getState()
            assert len(r.getState()['points']) == 3
    
            # hover over center
            center = r.mapToScene(pg.Point(3, 3))
            mouseMove(plt, center)
>           assertImageApproved(plt, 'roi/polylineroi/'+name+'_hover_roi', 'Hover mouse over center of ROI.')

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/graphicsItems/tests/test_ROI.py:193: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:185: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        ...,
        [  0,  ...,
        ...,
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/image_testing.py:273: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for roi/polylineroi/closed_hover_roi ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff7587adc0>
bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]

<PyQt5.QtWidgets.QGraphicsWidget object at 0x3ff7587a9d0>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff7587aaf0>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[-0.7071067811865475, 10.707106781186548], [-1.0606601717798212, 16.060660171779823]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff7587aca0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff7587ac10>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [17.52 0.00 0.00]
      [0.00 -11.68 0.00]
      [12.39 187.61 1.00]
        <pyqtgraph.graphicsItems.ROI.PolyLineROI object at 0x3ff758524c0>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 10.0, 15.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI._PolyLineSegment object at 0x3ff75852ee0>
            bounding rect: PyQt5.QtCore.QRectF(-0.9131370849898477, 0.0, 1.8262741699796954, 15.0)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI._PolyLineSegment object at 0x3ff75852f70>
            bounding rect: PyQt5.QtCore.QRectF(0.0, -1.3697056274847716, 10.0, 2.7394112549695433)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI._PolyLineSegment object at 0x3ff75852790>
            bounding rect: PyQt5.QtCore.QRectF(-0.645685424949238, -0.9685281374238572, 11.291370849898478, 16.937056274847713)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI.Handle object at 0x3ff75852ca0>
            bounding rect: PyQt5.QtCore.QRectF(-0.20177669529663686, -0.30266504294495655, 0.40355339059327383, 0.6053300858899108)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI.Handle object at 0x3ff758529d0>
            bounding rect: PyQt5.QtCore.QRectF(-0.2017766952966364, -0.30266504294495655, 0.4035533905932738, 0.6053300858899108)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI.Handle object at 0x3ff75852b80>
            bounding rect: PyQt5.QtCore.QRectF(-0.20177669529663686, -0.30266504294495533, 0.40355339059327383, 0.6053300858899109)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff7587ae50>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff7587ad30>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


________________________________ test_makeARGB _________________________________

    def test_makeARGB():
        # Many parameters to test here:
        #  * data dtype (ubyte, uint16, float, others)
        #  * data ndim (2 or 3)
        #  * levels (None, 1D, or 2D)
        #  * lut dtype
        #  * lut size
        #  * lut ndim (1 or 2)
        #  * useRGBA argument
        # Need to check that all input values map to the correct output values, especially
        # at and beyond the edges of the level range.
    
        def checkArrays(a, b):
            # because py.test output is difficult to read for arrays
            if not np.all(a == b):
                comp = []
                for i in range(a.shape[0]):
                    if a.shape[1] > 1:
                        comp.append('[')
                    for j in range(a.shape[1]):
                        m = a[i,j] == b[i,j]
                        comp.append('%d,%d  %s %s  %s%s' %
                                    (i, j, str(a[i,j]).ljust(15), str(b[i,j]).ljust(15),
                                     m, ' ********' if not np.all(m) else ''))
                    if a.shape[1] > 1:
                        comp.append(']')
                raise Exception("arrays do not match:\n%s" % '\n'.join(comp))
    
        def checkImage(img, check, alpha, alphaCheck):
            assert img.dtype == np.ubyte
            assert alpha is alphaCheck
            if alpha is False:
                checkArrays(img[..., 3], 255)
    
            if np.isscalar(check) or check.ndim == 3:
                checkArrays(img[..., :3], check)
            elif check.ndim == 2:
                checkArrays(img[..., :3], check[..., np.newaxis])
            elif check.ndim == 1:
                checkArrays(img[..., :3], check[..., np.newaxis, np.newaxis])
            else:
                raise Exception('invalid check array ndim')
    
        # uint8 data tests
    
        im1 = np.arange(256).astype('ubyte').reshape(256, 1)
        im2, alpha = pg.makeARGB(im1, levels=(0, 255))
        checkImage(im2, im1, alpha, False)
    
        im3, alpha = pg.makeARGB(im1, levels=(0.0, 255.0))
        checkImage(im3, im1, alpha, False)
    
        im4, alpha = pg.makeARGB(im1, levels=(255, 0))
        checkImage(im4, 255-im1, alpha, False)
    
        im5, alpha = pg.makeARGB(np.concatenate([im1]*3, axis=1), levels=[(0, 255), (0.0, 255.0), (255, 0)])
        checkImage(im5, np.concatenate([im1, im1, 255-im1], axis=1), alpha, False)
    
    
        im2, alpha = pg.makeARGB(im1, levels=(128,383))
        checkImage(im2[:128], 0, alpha, False)
        checkImage(im2[128:], im1[:128], alpha, False)
    
    
        # uint8 data + uint8 LUT
        lut = np.arange(256)[::-1].astype(np.uint8)
        im2, alpha = pg.makeARGB(im1, lut=lut)
        checkImage(im2, lut, alpha, False)
    
        # lut larger than maxint
        lut = np.arange(511).astype(np.uint8)
        im2, alpha = pg.makeARGB(im1, lut=lut)
        checkImage(im2, lut[::2], alpha, False)
    
        # lut smaller than maxint
        lut = np.arange(128).astype(np.uint8)
        im2, alpha = pg.makeARGB(im1, lut=lut)
        checkImage(im2, np.linspace(0, 127.5, 256, dtype='ubyte'), alpha, False)
    
        # lut + levels
        lut = np.arange(256)[::-1].astype(np.uint8)
        im2, alpha = pg.makeARGB(im1, lut=lut, levels=[-128, 384])
        checkImage(im2, np.linspace(191.5, 64.5, 256, dtype='ubyte'), alpha, False)
    
        im2, alpha = pg.makeARGB(im1, lut=lut, levels=[64, 192])
        checkImage(im2, np.clip(np.linspace(384.5, -127.5, 256), 0, 255).astype('ubyte'), alpha, False)
    
        # uint8 data + uint16 LUT
        lut = np.arange(4096)[::-1].astype(np.uint16) // 16
        im2, alpha = pg.makeARGB(im1, lut=lut)
        checkImage(im2, np.arange(256)[::-1].astype('ubyte'), alpha, False)
    
        # uint8 data + float LUT
        lut = np.linspace(10., 137., 256)
        im2, alpha = pg.makeARGB(im1, lut=lut)
        checkImage(im2, lut.astype('ubyte'), alpha, False)
    
        # uint8 data + 2D LUT
        lut = np.zeros((256, 3), dtype='ubyte')
        lut[:,0] = np.arange(256)
        lut[:,1] = np.arange(256)[::-1]
        lut[:,2] = 7
>       im2, alpha = pg.makeARGB(im1, lut=lut)

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/tests/test_functions.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

data = array([[[  0, 255,   7]],

       [[  1, 254,   7]],

       [[  2, 253,   7]],

       [[  3, 252,   7]],

       [[ ...      [[252,   3,   7]],

       [[253,   2,   7]],

       [[254,   1,   7]],

       [[255,   0,   7]]], dtype=uint8)
lut = array([[  0, 255,   7],
       [  1, 254,   7],
       [  2, 253,   7],
       [  3, 252,   7],
       [  4, 251,   7]... 4,   7],
       [252,   3,   7],
       [253,   2,   7],
       [254,   1,   7],
       [255,   0,   7]], dtype=uint8)
levels = array([  0., 255.]), scale = 256, useRGBA = False, output = None

    def makeARGB(data, lut=None, levels=None, scale=None, useRGBA=False, output=None):
        """
        Convert an array of values into an ARGB array suitable for building QImages,
        OpenGL textures, etc.
    
        Returns the ARGB array (unsigned byte) and a boolean indicating whether
        there is alpha channel data. This is a two stage process:
    
            1) Rescale the data based on the values in the *levels* argument (min, max).
            2) Determine the final output by passing the rescaled values through a
               lookup table.
    
        Both stages are optional.
    
        ============== ==================================================================================
        **Arguments:**
        data           numpy array of int/float types. If
        levels         List [min, max]; optionally rescale data before converting through the
                       lookup table. The data is rescaled such that min->0 and max->*scale*::
    
                          rescaled = (clip(data, min, max) - min) * (*scale* / (max - min))
    
                       It is also possible to use a 2D (N,2) array of values for levels. In this case,
                       it is assumed that each pair of min,max values in the levels array should be
                       applied to a different subset of the input data (for example, the input data may
                       already have RGB values and the levels are used to independently scale each
                       channel). The use of this feature requires that levels.shape[0] == data.shape[-1].
        scale          The maximum value to which data will be rescaled before being passed through the
                       lookup table (or returned if there is no lookup table). By default this will
                       be set to the length of the lookup table, or 255 if no lookup table is provided.
        lut            Optional lookup table (array with dtype=ubyte).
                       Values in data will be converted to color by indexing directly from lut.
                       The output data shape will be input.shape + lut.shape[1:].
                       Lookup tables can be built using ColorMap or GradientWidget.
        useRGBA        If True, the data is returned in RGBA order (useful for building OpenGL textures).
                       The default is False, which returns in ARGB order for use with QImage
                       (Note that 'ARGB' is a term used by the Qt documentation; the *actual* order
                       is BGRA).
        ============== ==================================================================================
        """
        cp = getCupy()
        xp = cp.get_array_module(data) if cp else np
        profile = debug.Profiler()
        if data.ndim not in (2, 3):
            raise TypeError("data must be 2D or 3D")
        if data.ndim == 3 and data.shape[2] > 4:
            raise TypeError("data.shape[2] must be <= 4")
    
        if lut is not None and not isinstance(lut, xp.ndarray):
            lut = xp.array(lut)
    
        if levels is None:
            # automatically decide levels based on data dtype
            if data.dtype.kind == 'u':
                levels = xp.array([0, 2**(data.itemsize*8)-1])
            elif data.dtype.kind == 'i':
                s = 2**(data.itemsize*8 - 1)
                levels = xp.array([-s, s-1])
            elif data.dtype.kind == 'b':
                levels = xp.array([0,1])
            else:
                raise Exception('levels argument is required for float input types')
        if not isinstance(levels, xp.ndarray):
            levels = xp.array(levels)
        levels = levels.astype(xp.float64)
        if levels.ndim == 1:
            if levels.shape[0] != 2:
                raise Exception('levels argument must have length 2')
        elif levels.ndim == 2:
            if lut is not None and lut.ndim > 1:
                raise Exception('Cannot make ARGB data when both levels and lut have ndim > 2')
            if levels.shape != (data.shape[-1], 2):
                raise Exception('levels must have shape (data.shape[-1], 2)')
        else:
            raise Exception("levels argument must be 1D or 2D (got shape=%s)." % repr(levels.shape))
    
        profile('check inputs')
    
        # Decide on maximum scaled value
        if scale is None:
            if lut is not None:
                scale = lut.shape[0]
            else:
                scale = 255.
    
        # Decide on the dtype we want after scaling
        if lut is None:
            dtype = xp.ubyte
        else:
            dtype = xp.min_scalar_type(lut.shape[0]-1)
    
        # awkward, but fastest numpy native nan evaluation
        nanMask = None
        if data.dtype.kind == 'f' and xp.isnan(data.min()):
            nanMask = xp.isnan(data)
            if data.ndim > 2:
                nanMask = xp.any(nanMask, axis=-1)
        # Apply levels if given
        if levels is not None:
            if isinstance(levels, xp.ndarray) and levels.ndim == 2:
                # we are going to rescale each channel independently
                if levels.shape[0] != data.shape[-1]:
                    raise Exception("When rescaling multi-channel data, there must be the same number of levels as channels (data.shape[-1] == levels.shape[0])")
                newData = xp.empty(data.shape, dtype=int)
                for i in range(data.shape[-1]):
                    minVal, maxVal = levels[i]
                    if minVal == maxVal:
                        maxVal = xp.nextafter(maxVal, 2*maxVal)
                    rng = maxVal-minVal
                    rng = 1 if rng == 0 else rng
                    newData[...,i] = rescaleData(data[...,i], scale / rng, minVal, dtype=dtype)
                data = newData
            else:
                # Apply level scaling unless it would have no effect on the data
                minVal, maxVal = levels
                if minVal != 0 or maxVal != scale:
                    if minVal == maxVal:
                        maxVal = xp.nextafter(maxVal, 2*maxVal)
                    rng = maxVal-minVal
                    rng = 1 if rng == 0 else rng
                    data = rescaleData(data, scale/rng, minVal, dtype=dtype)
    
        profile('apply levels')
    
        # apply LUT if given
        if lut is not None:
            data = applyLookupTable(data, lut)
        else:
            if data.dtype != xp.ubyte:
                data = xp.clip(data, 0, 255).astype(xp.ubyte)
    
        profile('apply lut')
    
        # this will be the final image array
        if output is None:
            imgData = xp.empty(data.shape[:2]+(4,), dtype=xp.ubyte)
        else:
            imgData = output
    
        profile('allocate')
    
        # decide channel order
        if useRGBA:
            order = [0,1,2,3] # array comes out RGBA
        elif sys.byteorder == 'little':
            order = [2,1,0,3] # ARGB32 little endian
        else:
            order = [3,0,1,2] # ARGB32 big endian
    
        # copy data into image array
        if data.ndim == 2:
            # This is tempting:
            #   imgData[..., :3] = data[..., xp.newaxis]
            # ..but it turns out this is faster:
            for i in range(3):
                imgData[..., i] = data
        elif data.shape[2] == 1:
            for i in range(3):
                imgData[..., i] = data[..., 0]
        else:
            for i in range(0, data.shape[2]):
>               imgData[..., i] = data[..., order[i]]
E               IndexError: index 3 is out of bounds for axis 2 with size 3

/builddir/build/BUILD/pyqtgraph-0.12.0/pyqtgraph/functions.py:1263: IndexError
=========================== short test summary info ============================
FAILED examples/test_examples.py::testExamples[ HistogramLUT.py - PyQt5 ]
FAILED examples/test_examples.py::testExamples[ ImageView.py - PyQt5 ]
FAILED pyqtgraph/graphicsItems/tests/test_ImageItem.py::test_ImageItem - Asse...
FAILED pyqtgraph/graphicsItems/tests/test_ImageItem.py::test_ImageItem_axisorder
FAILED pyqtgraph/graphicsItems/tests/test_NonUniformImage.py::test_NonUniformImage_lut
FAILED pyqtgraph/graphicsItems/tests/test_NonUniformImage.py::test_NonUniformImage_colormap
FAILED pyqtgraph/graphicsItems/tests/test_ROI.py::test_getArrayRegion - Asser...
FAILED pyqtgraph/graphicsItems/tests/test_ROI.py::test_getArrayRegion_axisorder
FAILED pyqtgraph/graphicsItems/tests/test_ROI.py::test_PolyLineROI - Assertio...
FAILED pyqtgraph/tests/test_functions.py::test_makeARGB - IndexError: index 3...
===== 10 failed, 200 passed, 5 skipped, 1 deselected in 208.74s (0:03:28) ======
```
I did another run where I checked out the entire source tree from your pull request, slightly different results:

```
+ xvfb-run -a py.test-3.9 -k 'not test_reload'
============================= test session starts ==============================
platform linux -- Python 3.9.2, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /builddir/build/BUILD/pyqtgraph-rgba_endian, configfile: pytest.ini
collected 215 items / 1 deselected / 1 skipped / 213 selected

examples/test_examples.py .............................sF............... [ 21%]
...............s.........................                                [ 40%]
pyqtgraph/dockarea/tests/test_dock.py ...                                [ 42%]
pyqtgraph/dockarea/tests/test_dockarea.py .                              [ 42%]
pyqtgraph/exporters/tests/test_csv.py .                                  [ 42%]
pyqtgraph/exporters/tests/test_hdf5.py ...                               [ 44%]
pyqtgraph/exporters/tests/test_image.py .                                [ 44%]
pyqtgraph/exporters/tests/test_svg.py ..                                 [ 45%]
pyqtgraph/graphicsItems/PlotItem/tests/test_PlotItem.py .....            [ 48%]
pyqtgraph/graphicsItems/ViewBox/tests/test_ViewBox.py ..s                [ 49%]
pyqtgraph/graphicsItems/ViewBox/tests/test_ViewBoxZoom.py ........       [ 53%]
pyqtgraph/graphicsItems/tests/test_ArrowItem.py .                        [ 53%]
pyqtgraph/graphicsItems/tests/test_AxisItem.py ......                    [ 56%]
pyqtgraph/graphicsItems/tests/test_ErrorBarItem.py .                     [ 57%]
pyqtgraph/graphicsItems/tests/test_GraphicsItem.py ..                    [ 57%]
pyqtgraph/graphicsItems/tests/test_ImageItem.py FF.                      [ 59%]
pyqtgraph/graphicsItems/tests/test_InfiniteLine.py ..                    [ 60%]
pyqtgraph/graphicsItems/tests/test_LegendItem.py .                       [ 60%]
pyqtgraph/graphicsItems/tests/test_NonUniformImage.py ...FF              [ 63%]
pyqtgraph/graphicsItems/tests/test_PlotCurveItem.py .                    [ 63%]
pyqtgraph/graphicsItems/tests/test_PlotDataItem.py ......                [ 66%]
pyqtgraph/graphicsItems/tests/test_ROI.py FFF                            [ 67%]
pyqtgraph/graphicsItems/tests/test_ScatterPlotItem.py ..                 [ 68%]
pyqtgraph/graphicsItems/tests/test_TextItem.py .                         [ 69%]
pyqtgraph/imageview/tests/test_imageview.py .                            [ 69%]
pyqtgraph/parametertree/tests/test_Parameter.py ....                     [ 71%]
pyqtgraph/parametertree/tests/test_parametertypes.py ....                [ 73%]
pyqtgraph/tests/test_Vector.py ..                                        [ 74%]
pyqtgraph/tests/test_configparser.py ..                                  [ 75%]
pyqtgraph/tests/test_exit_crash.py s.                                    [ 76%]
pyqtgraph/tests/test_functions.py .....F...............                  [ 85%]
pyqtgraph/tests/test_qt.py ..                                            [ 86%]
pyqtgraph/tests/test_ref_cycles.py ...                                   [ 88%]
pyqtgraph/tests/test_signalproxy.py ....                                 [ 90%]
pyqtgraph/tests/test_srttransform3d.py .                                 [ 90%]
pyqtgraph/util/tests/test_lru_cache.py .                                 [ 91%]
pyqtgraph/widgets/tests/test_combobox.py .                               [ 91%]
pyqtgraph/widgets/tests/test_graphics_view.py .                          [ 92%]
pyqtgraph/widgets/tests/test_histogramlutwidget.py .                     [ 92%]
pyqtgraph/widgets/tests/test_spinbox.py ...............                  [ 99%]
pyqtgraph/widgets/tests/test_tablewidget.py .                            [100%]

=================================== FAILURES ===================================
___________________ testExamples[ HistogramLUT.py - PyQt5 ] ____________________

0

Python 3.9.2 (default, Feb 20 2021, 00:00:00) 
[GCC 11.0.0 20210210 (Red Hat 11.0.0-0)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/functions.py", line 1267, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/functions.py", line 1267, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
>>> 

Failed Histogram / lookup table Example Test Located in HistogramLUT.py 
----------------------------- Captured stdout call -----------------------------
Histogram / lookup table 
0

Python 3.9.2 (default, Feb 20 2021, 00:00:00) 
[GCC 11.0.0 20210210 (Red Hat 11.0.0-0)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/functions.py", line 1267, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/functions.py", line 1267, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
>>> 

________________________________ test_ImageItem ________________________________

transpose = False

    def test_ImageItem(transpose=False):
    
        w = pg.GraphicsLayoutWidget()
        w.show()
        view = pg.ViewBox()
        w.setCentralWidget(view)
        w.resize(200, 200)
        img = TransposedImageItem(border=0.5, transpose=transpose)
    
        view.addItem(img)
    
        # test mono float
        np.random.seed(0)
        data = np.random.normal(size=(20, 20))
        dmax = data.max()
        data[:10, 1] = dmax + 10
        data[1, :10] = dmax + 12
        data[3, :10] = dmax + 13
        img.setImage(data)
    
        QtTest.QTest.qWaitForWindowExposed(w)
        time.sleep(0.1)
        app.processEvents()
        assertImageApproved(w, 'imageitem/init', 'Init image item. View is auto-scaled, image axis 0 marked by 1 line, axis 1 is marked by 2 lines. Origin in bottom-left.')
    
        # ..with colormap
        cmap = pg.ColorMap([0, 0.25, 0.75, 1], [[0, 0, 0, 255], [255, 0, 0, 255], [255, 255, 0, 255], [255, 255, 255, 255]])
        img.setLookupTable(cmap.getLookupTable())
        assertImageApproved(w, 'imageitem/lut', 'Set image LUT.')
    
        # ..and different levels
        img.setLevels([dmax+9, dmax+13])
        assertImageApproved(w, 'imageitem/levels1', 'Levels show only axis lines.')
    
        img.setLookupTable(None)
    
        # test mono int
        data = np.fromfunction(lambda x,y: x+y*10, (129, 128)).astype(np.int16)
        img.setImage(data)
        assertImageApproved(w, 'imageitem/gradient_mono_int', 'Mono int gradient.')
    
        img.setLevels([640, 641])
        assertImageApproved(w, 'imageitem/gradient_mono_int_levels', 'Mono int gradient w/ levels to isolate diagonal.')
    
        # test mono byte
        data = np.fromfunction(lambda x,y: x+y, (129, 128)).astype(np.ubyte)
        img.setImage(data)
        assertImageApproved(w, 'imageitem/gradient_mono_byte', 'Mono byte gradient.')
    
        img.setLevels([127, 128])
        assertImageApproved(w, 'imageitem/gradient_mono_byte_levels', 'Mono byte gradient w/ levels to isolate diagonal.')
    
        # test monochrome image
        data = np.zeros((10, 10), dtype='uint8')
        data[:5,:5] = 1
        data[5:,5:] = 1
        img.setImage(data)
        assertImageApproved(w, 'imageitem/monochrome', 'Ubyte image with only 0,1 values.')
    
        # test bool
        data = data.astype(bool)
        img.setImage(data)
        assertImageApproved(w, 'imageitem/bool', 'Boolean mask.')
    
        # test RGBA byte
        data = np.zeros((100, 100, 4), dtype='ubyte')
        data[..., 0] = np.linspace(0, 255, 100).reshape(100, 1)
        data[..., 1] = np.linspace(0, 255, 100).reshape(1, 100)
        data[..., 3] = 255
        img.setImage(data)
>       assertImageApproved(w, 'imageitem/gradient_rgba_byte', 'RGBA byte gradient.')

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/tests/test_ImageItem.py:81: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/image_testing.py:185: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        ...,
        [  0,  ...,
        ...,
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/image_testing.py:273: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for imageitem/gradient_rgba_byte ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff84748040>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[-7.0710678118654755, 107.07106781186548], [-7.0710678118654755, 107.07106781186548]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84748700>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff84748430>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [1.75 0.00 0.00]
      [0.00 -1.75 0.00]
      [12.39 187.61 1.00]
        <pyqtgraph.tests.image_testing.TransposedImageItem object at 0x3ff84cefee0>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 100.0, 100.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff847480d0>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84748790>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84748160>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/functions.py", line 1267, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/functions.py", line 1267, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/functions.py", line 1267, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/functions.py", line 1267, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
___________________________ test_ImageItem_axisorder ___________________________

    def test_ImageItem_axisorder():
        # All image tests pass again using the opposite axis order
        origMode = pg.getConfigOption('imageAxisOrder')
        altMode = 'row-major' if origMode == 'col-major' else 'col-major'
        pg.setConfigOptions(imageAxisOrder=altMode)
        try:
>           test_ImageItem(transpose=True)

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/tests/test_ImageItem.py:132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/tests/test_ImageItem.py:81: in test_ImageItem
    assertImageApproved(w, 'imageitem/gradient_rgba_byte', 'RGBA byte gradient.')
/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/image_testing.py:185: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        ...,
        [  0,  ...,
        ...,
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/image_testing.py:273: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for imageitem/gradient_rgba_byte ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff84b564c0>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[-7.0710678118654755, 107.07106781186548], [-7.0710678118654755, 107.07106781186548]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84b56b80>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff84b56820>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [1.75 0.00 0.00]
      [0.00 -1.75 0.00]
      [12.39 187.61 1.00]
        <pyqtgraph.tests.image_testing.TransposedImageItem object at 0x3ff84bc9310>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 100.0, 100.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84b569d0>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84ce7280>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84b56670>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/functions.py", line 1267, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/functions.py", line 1267, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/functions.py", line 1267, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 462, in paint
    self.render()
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/ImageItem.py", line 451, in render
    fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
  File "/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/functions.py", line 1267, in makeARGB
    imgData[..., i] = data[..., order[i]] 
IndexError: index 3 is out of bounds for axis 2 with size 3
___________________________ test_NonUniformImage_lut ___________________________

    def test_NonUniformImage_lut():
    
        window = pg.GraphicsLayoutWidget()
        viewbox = pg.ViewBox()
        window.setCentralWidget(viewbox)
        window.resize(200, 200)
        window.show()
    
        x = [1.0, 3.0, 10.0]
        y = [1.0, 2.0, 4.0]
        X, Y = np.meshgrid(x, y, indexing='ij')
        Z = X * Y
    
        image = NonUniformImage(x, y, Z, border=fn.mkPen('g'))
        viewbox.addItem(image)
    
        lut = pg.HistogramLUTItem()
        window.addItem(lut)
    
        image.setLookupTable(lut, autoLevel=True)
    
        h = image.getHistogram()
        lut.plot.setData(*h)
    
        QtTest.QTest.qWaitForWindowExposed(window)
        QtTest.QTest.qWait(100)
    
>       assertImageApproved(window, 'nonuniform_image/lut-3x3')

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/tests/test_NonUniformImage.py:76: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/image_testing.py:185: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        ...,
        [  0,  ...,
        ...,
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/image_testing.py:273: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for nonuniform_image/lut-3x3 ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff845ee3a0>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[0.36360389693210726, 10.636396103067893], [0.7878679656440357, 4.212132034355964]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff845ee700>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff845ee670>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [19.47 0.00 0.00]
      [0.00 -58.41 0.00]
      [-7.08 246.02 1.00]
        <pyqtgraph.graphicsItems.NonUniformImage.NonUniformImage object at 0x3ff845f7160>
        bounding rect: PyQt5.QtCore.QRectF(1.0, 1.0, 9.0, 3.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff845ee820>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff845ee8b0>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff845ee790>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


________________________ test_NonUniformImage_colormap _________________________

    def test_NonUniformImage_colormap():
    
        window = pg.GraphicsLayoutWidget()
        viewbox = pg.ViewBox()
        window.setCentralWidget(viewbox)
        window.resize(200, 200)
        window.show()
    
        x = [1.0, 3.0, 10.0]
        y = [1.0, 2.0, 4.0]
        X, Y = np.meshgrid(x, y, indexing='ij')
        Z = X * Y
    
        Z[:, 0] = [np.NINF, np.NAN, np.PINF]
    
        image = NonUniformImage(x, y, Z, border=fn.mkPen('g'))
    
        cmap = ColorMap(pos=[0.0, 1.0], color=[(0.0, 0.0, 0.0, 1.0), (1.0, 1.0, 1.0, 1.0)], mode='rgb')
        image.setColorMap(cmap)
    
        viewbox.addItem(image)
    
        QtTest.QTest.qWaitForWindowExposed(window)
        QtTest.QTest.qWait(100)
    
>       assertImageApproved(window, 'nonuniform_image/colormap-3x3')

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/tests/test_NonUniformImage.py:104: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/image_testing.py:185: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        ...,
        [  0,  ...,
        ...,
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/image_testing.py:273: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for nonuniform_image/colormap-3x3 ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff845d78b0>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[0.36360389693210726, 10.636396103067893], [0.7878679656440357, 4.212132034355964]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff845d7820>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff845d7790>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [19.47 0.00 0.00]
      [0.00 -58.41 0.00]
      [-7.08 246.02 1.00]
        <pyqtgraph.graphicsItems.NonUniformImage.NonUniformImage object at 0x3ff84676310>
        bounding rect: PyQt5.QtCore.QRectF(1.0, 1.0, 9.0, 3.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff845d7a60>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff845d7af0>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff845d79d0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


_____________________________ test_getArrayRegion ______________________________

transpose = False

    def test_getArrayRegion(transpose=False):
        pr = pg.PolyLineROI([[0, 0], [27, 0], [0, 28]], closed=True)
        pr.setPos(1, 1)
        rois = [
            (pg.ROI([1, 1], [27, 28], pen='y'), 'baseroi'),
            (pg.RectROI([1, 1], [27, 28], pen='y'), 'rectroi'),
            (pg.EllipseROI([1, 1], [27, 28], pen='y'), 'ellipseroi'),
            (pr, 'polylineroi'),
        ]
        for roi, name in rois:
            # For some ROIs, resize should not be used.
            testResize = not isinstance(roi, pg.PolyLineROI)
    
            origMode = pg.getConfigOption('imageAxisOrder')
            try:
                if transpose:
                    pg.setConfigOptions(imageAxisOrder='row-major')
                    check_getArrayRegion(roi, 'roi/'+name, testResize, transpose=True)
                else:
                    pg.setConfigOptions(imageAxisOrder='col-major')
>                   check_getArrayRegion(roi, 'roi/'+name, testResize)

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/tests/test_ROI.py:33: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/tests/test_ROI.py:100: in check_getArrayRegion
    assertImageApproved(win, name+'/roi_getarrayregion', 'Simple ROI region selection.')
/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/image_testing.py:185: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        ...,
        [  0,  ...,
        ...,
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 800, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/image_testing.py:273: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for roi/baseroi/roi_getarrayregion ======
view size: 200x400
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <PyQt5.QtWidgets.QGraphicsWidget object at 0x3ff84667a60>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 400.0)
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff84676a60>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
view range: [[-2.274291477622673, 29.274291477622675], [-2.0260088948187804, 30.02600889481878]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84676820>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff846769d0>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [5.96 0.00 0.00]
      [0.00 -5.96 0.00]
      [13.55 178.93 1.00]
        <pyqtgraph.graphicsItems.ImageItem.ImageItem object at 0x3ff84664b80>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 27.0, 28.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84676e50>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84676430>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84676670>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff84674d30>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
view range: [[-2.464394135939392, 32.464394135939386], [-2.243081276406507, 33.24308127640651]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84674b80>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff84674ca0>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [5.38 0.00 0.00]
      [0.00 -5.38 0.00]
      [13.26 178.93 1.00]
        <pyqtgraph.graphicsItems.ImageItem.ImageItem object at 0x3ff84664310>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 30.0, 31.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <pyqtgraph.graphicsItems.ROI.ROI object at 0x3ff84664ee0>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 27.0, 28.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84674a60>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff846749d0>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84674af0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


________________________ test_getArrayRegion_axisorder _________________________

    def test_getArrayRegion_axisorder():
>       test_getArrayRegion(transpose=True)

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/tests/test_ROI.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/tests/test_ROI.py:30: in test_getArrayRegion
    check_getArrayRegion(roi, 'roi/'+name, testResize, transpose=True)
/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/tests/test_ROI.py:100: in check_getArrayRegion
    assertImageApproved(win, name+'/roi_getarrayregion', 'Simple ROI region selection.')
/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/image_testing.py:185: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        ...,
        [  0,  ...,
        ...,
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 800, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/image_testing.py:273: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for roi/baseroi/roi_getarrayregion ======
view size: 200x400
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <PyQt5.QtWidgets.QGraphicsWidget object at 0x3ff84667280>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 400.0)
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff846c43a0>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
view range: [[-2.274291477622673, 29.274291477622675], [-2.0260088948187804, 30.02600889481878]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff846c4550>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff846c44c0>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [5.96 0.00 0.00]
      [0.00 -5.96 0.00]
      [13.55 178.93 1.00]
        <pyqtgraph.graphicsItems.ImageItem.ImageItem object at 0x3ff846d7dc0>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 27.0, 28.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff846c4670>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff846c4700>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff846c45e0>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff84667160>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
view range: [[-2.464394135939392, 32.464394135939386], [-2.243081276406507, 33.24308127640651]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84667310>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff84667040>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [5.38 0.00 0.00]
      [0.00 -5.38 0.00]
      [13.26 178.93 1.00]
        <pyqtgraph.graphicsItems.ImageItem.ImageItem object at 0x3ff846d7d30>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 30.0, 31.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <pyqtgraph.graphicsItems.ROI.ROI object at 0x3ff84671670>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 27.0, 28.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
        <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84667c10>
        bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84667af0>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff84667d30>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 188.0, 191.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


_______________________________ test_PolyLineROI _______________________________

    def test_PolyLineROI():
        rois = [
            (pg.PolyLineROI([[0, 0], [10, 0], [0, 15]], closed=True, pen=0.3), 'closed'),
            (pg.PolyLineROI([[0, 0], [10, 0], [0, 15]], closed=False, pen=0.3), 'open')
        ]
    
        #plt = pg.plot()
        plt = pg.GraphicsView()
        plt.show()
        resizeWindow(plt, 200, 200)
        vb = pg.ViewBox()
        plt.scene().addItem(vb)
        vb.resize(200, 200)
        #plt.plotItem = pg.PlotItem()
        #plt.scene().addItem(plt.plotItem)
        #plt.plotItem.resize(200, 200)
    
    
        plt.scene().minDragTime = 0  # let us simulate mouse drags very quickly.
    
        # seemingly arbitrary requirements; might need longer wait time for some platforms..
        QtTest.QTest.qWaitForWindowExposed(plt)
        QtTest.QTest.qWait(100)
    
        for r, name in rois:
            vb.clear()
            vb.addItem(r)
            vb.autoRange()
            app.processEvents()
    
            assertImageApproved(plt, 'roi/polylineroi/'+name+'_init', 'Init %s polyline.' % name)
            initState = r.getState()
            assert len(r.getState()['points']) == 3
    
            # hover over center
            center = r.mapToScene(pg.Point(3, 3))
            mouseMove(plt, center)
>           assertImageApproved(plt, 'roi/polylineroi/'+name+'_hover_roi', 'Hover mouse over center of ROI.')

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/graphicsItems/tests/test_ROI.py:193: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/image_testing.py:185: in assertImageApproved
    assertImageMatch(image, stdImage, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

im1 = array([[[  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        ...,
        [  0,  ...,
        ...,
        [  0,   0,   0, 255],
        [  0,   0,   0, 255],
        [  0,   0,   0, 255]]], dtype=uint8)
im2 = array([[[255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        ...,
        [255,  ...,
        ...,
        [255,   0,   0, 255],
        [255,   0,   0, 255],
        [255,   0,   0, 255]]], dtype=uint8)
minCorr = None, pxThreshold = 50.0, pxCount = 400, maxPxDiff = None
avgPxDiff = None, imgDiff = None

    def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
                           pxCount=-1, maxPxDiff=None, avgPxDiff=None,
                           imgDiff=None):
        """Check that two images match.
    
        Images that differ in shape or dtype will fail unconditionally.
        Further tests for similarity depend on the arguments supplied.
    
        By default, images may have no pixels that gave a value difference greater
        than 50.
    
        Parameters
        ----------
        im1 : (h, w, 4) ndarray
            Test output image
        im2 : (h, w, 4) ndarray
            Test standard image
        minCorr : float or None
            Minimum allowed correlation coefficient between corresponding image
            values (see numpy.corrcoef)
        pxThreshold : float
            Minimum value difference at which two pixels are considered different
        pxCount : int or None
            Maximum number of pixels that may differ. Default is 0 for Qt4 and
            1% of image size for Qt5.
        maxPxDiff : float or None
            Maximum allowed difference between pixels
        avgPxDiff : float or None
            Average allowed difference between pixels
        imgDiff : float or None
            Maximum allowed summed difference between images
    
        """
        assert im1.ndim == 3
        assert im1.shape[2] == 4
        assert im1.dtype == im2.dtype
    
        if pxCount == -1:
            if QT_LIB in {'PyQt5', 'PySide2', 'PySide6', 'PyQt6'}:
                # Qt5 generates slightly different results; relax the tolerance
                # until test images are updated.
                pxCount = int(im1.shape[0] * im1.shape[1] * 0.01)
            else:
                pxCount = 0
    
        diff = im1.astype(float) - im2.astype(float)
        if imgDiff is not None:
            assert np.abs(diff).sum() <= imgDiff
    
        pxdiff = diff.max(axis=2)  # largest value difference per pixel
        mask = np.abs(pxdiff) >= pxThreshold
        if pxCount is not None:
>           assert mask.sum() <= pxCount
E           AssertionError

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/image_testing.py:273: AssertionError
----------------------------- Captured stdout call -----------------------------
====== Scenegraph state for roi/polylineroi/closed_hover_roi ======
view size: 200x200
view transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
  <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff846c7790>
bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]

<PyQt5.QtWidgets.QGraphicsWidget object at 0x3ff846c73a0>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]

<pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox object at 0x3ff846c74c0>
bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
view range: [[-0.7071067811865475, 10.707106781186548], [-1.0606601717798212, 16.060660171779823]]
transform:
  [1.00 0.00 0.00]
  [0.00 1.00 0.00]
  [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff846c7670>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <pyqtgraph.graphicsItems.ViewBox.ViewBox.ChildGroup object at 0x3ff846c75e0>
    bounding rect: PyQt5.QtCore.QRectF()
    transform:
      [17.52 0.00 0.00]
      [0.00 -11.68 0.00]
      [12.39 187.61 1.00]
        <pyqtgraph.graphicsItems.ROI.PolyLineROI object at 0x3ff846d7f70>
        bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 10.0, 15.0)
        transform:
          [1.00 0.00 0.00]
          [0.00 1.00 0.00]
          [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI._PolyLineSegment object at 0x3ff846ea310>
            bounding rect: PyQt5.QtCore.QRectF(-0.9131370849898477, 0.0, 1.8262741699796954, 15.0)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI._PolyLineSegment object at 0x3ff846ea430>
            bounding rect: PyQt5.QtCore.QRectF(0.0, -1.3697056274847716, 10.0, 2.7394112549695433)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI._PolyLineSegment object at 0x3ff846ea5e0>
            bounding rect: PyQt5.QtCore.QRectF(-0.645685424949238, -0.9685281374238572, 11.291370849898478, 16.937056274847713)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI.Handle object at 0x3ff846eac10>
            bounding rect: PyQt5.QtCore.QRectF(-0.20177669529663686, -0.30266504294495655, 0.40355339059327383, 0.6053300858899108)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI.Handle object at 0x3ff846ead30>
            bounding rect: PyQt5.QtCore.QRectF(-0.2017766952966364, -0.30266504294495655, 0.4035533905932738, 0.6053300858899108)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
            <pyqtgraph.graphicsItems.ROI.Handle object at 0x3ff846ea700>
            bounding rect: PyQt5.QtCore.QRectF(-0.20177669529663686, -0.30266504294495533, 0.40355339059327383, 0.6053300858899109)
            transform:
              [1.00 0.00 0.00]
              [0.00 1.00 0.00]
              [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff846c7820>
    bounding rect: PyQt5.QtCore.QRectF(-0.5, -0.5, 2.0, 2.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]
    <PyQt5.QtWidgets.QGraphicsRectItem object at 0x3ff846c7700>
    bounding rect: PyQt5.QtCore.QRectF(0.0, 0.0, 200.0, 200.0)
    transform:
      [1.00 0.00 0.00]
      [0.00 1.00 0.00]
      [0.00 0.00 1.00]


________________________________ test_makeARGB _________________________________

    def test_makeARGB():
        # Many parameters to test here:
        #  * data dtype (ubyte, uint16, float, others)
        #  * data ndim (2 or 3)
        #  * levels (None, 1D, or 2D)
        #  * lut dtype
        #  * lut size
        #  * lut ndim (1 or 2)
        #  * useRGBA argument
        # Need to check that all input values map to the correct output values, especially
        # at and beyond the edges of the level range.
    
        def checkArrays(a, b):
            # because py.test output is difficult to read for arrays
            if not np.all(a == b):
                comp = []
                for i in range(a.shape[0]):
                    if a.shape[1] > 1:
                        comp.append('[')
                    for j in range(a.shape[1]):
                        m = a[i,j] == b[i,j]
                        comp.append('%d,%d  %s %s  %s%s' %
                                    (i, j, str(a[i,j]).ljust(15), str(b[i,j]).ljust(15),
                                     m, ' ********' if not np.all(m) else ''))
                    if a.shape[1] > 1:
                        comp.append(']')
                raise Exception("arrays do not match:\n%s" % '\n'.join(comp))
    
        def checkImage(img, check, alpha, alphaCheck):
            assert img.dtype == np.ubyte
            assert alpha is alphaCheck
            if alpha is False:
                checkArrays(img[..., 3], 255)
    
            if np.isscalar(check) or check.ndim == 3:
                checkArrays(img[..., :3], check)
            elif check.ndim == 2:
                checkArrays(img[..., :3], check[..., np.newaxis])
            elif check.ndim == 1:
                checkArrays(img[..., :3], check[..., np.newaxis, np.newaxis])
            else:
                raise Exception('invalid check array ndim')
    
        # uint8 data tests
    
        im1 = np.arange(256).astype('ubyte').reshape(256, 1)
        im2, alpha = pg.makeARGB(im1, levels=(0, 255))
>       checkImage(im2, im1, alpha, False)

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/test_functions.py:197: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/test_functions.py:182: in checkImage
    checkArrays(img[..., 3], 255)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

a = array([[  0],
       [  1],
       [  2],
       [  3],
       [  4],
       [  5],
       [  6],
       [  7],
      ... [248],
       [249],
       [250],
       [251],
       [252],
       [253],
       [254],
       [255]], dtype=uint8)
b = 255

    def checkArrays(a, b):
        # because py.test output is difficult to read for arrays
        if not np.all(a == b):
            comp = []
            for i in range(a.shape[0]):
                if a.shape[1] > 1:
                    comp.append('[')
                for j in range(a.shape[1]):
>                   m = a[i,j] == b[i,j]
E                   TypeError: 'int' object is not subscriptable

/builddir/build/BUILD/pyqtgraph-rgba_endian/pyqtgraph/tests/test_functions.py:170: TypeError
=========================== short test summary info ============================
FAILED examples/test_examples.py::testExamples[ HistogramLUT.py - PyQt5 ]
FAILED pyqtgraph/graphicsItems/tests/test_ImageItem.py::test_ImageItem - Asse...
FAILED pyqtgraph/graphicsItems/tests/test_ImageItem.py::test_ImageItem_axisorder
FAILED pyqtgraph/graphicsItems/tests/test_NonUniformImage.py::test_NonUniformImage_lut
FAILED pyqtgraph/graphicsItems/tests/test_NonUniformImage.py::test_NonUniformImage_colormap
FAILED pyqtgraph/graphicsItems/tests/test_ROI.py::test_getArrayRegion - Asser...
FAILED pyqtgraph/graphicsItems/tests/test_ROI.py::test_getArrayRegion_axisorder
FAILED pyqtgraph/graphicsItems/tests/test_ROI.py::test_PolyLineROI - Assertio...
FAILED pyqtgraph/tests/test_functions.py::test_makeARGB - TypeError: 'int' ob...
====== 9 failed, 201 passed, 5 skipped, 1 deselected in 155.98s (0:02:35) ======
```

Resolving patch:
diff --git a/pyqtgraph/functions.py b/pyqtgraph/functions.py
--- a/pyqtgraph/functions.py
+++ b/pyqtgraph/functions.py
@@ -1242,9 +1242,11 @@ def makeARGB(data, lut=None, levels=None, scale=None, useRGBA=False, output=None
 
     # decide channel order
     if useRGBA:
-        order = [0,1,2,3] # array comes out RGBA
+        dst_order = [0, 1, 2, 3]    # R,G,B,A
+    elif sys.byteorder == 'little':
+        dst_order = [2, 1, 0, 3]    # B,G,R,A (ARGB32 little endian)
     else:
-        order = [2,1,0,3] # for some reason, the colors line up as BGR in the final image.
+        dst_order = [1, 2, 3, 0]    # A,R,G,B (ARGB32 big endian)
         
     # copy data into image array
     fastpath = try_fastpath_argb(xp, data, imgData, useRGBA)
@@ -1256,13 +1258,13 @@ def makeARGB(data, lut=None, levels=None, scale=None, useRGBA=False, output=None
         #   imgData[..., :3] = data[..., xp.newaxis]
         # ..but it turns out this is faster:
         for i in range(3):
-            imgData[..., i] = data
+            imgData[..., dst_order[i]] = data
     elif data.shape[2] == 1:
         for i in range(3):
-            imgData[..., i] = data[..., 0]
+            imgData[..., dst_order[i]] = data[..., 0]
     else:
         for i in range(0, data.shape[2]):
-            imgData[..., i] = data[..., order[i]] 
+            imgData[..., dst_order[i]] = data[..., i]
         
     profile('reorder channels')
     
@@ -1272,16 +1274,16 @@ def makeARGB(data, lut=None, levels=None, scale=None, useRGBA=False, output=None
     else:
         alpha = False
         if not fastpath:    # fastpath has already filled it in
-            imgData[..., 3] = 255
+            imgData[..., dst_order[3]] = 255
 
     # apply nan mask through alpha channel
     if nanMask is not None:
         alpha = True
         # Workaround for https://github.com/cupy/cupy/issues/4693
         if xp == cp:
-            imgData[nanMask, :, 3] = 0
+            imgData[nanMask, :, dst_order[3]] = 0
         else:
-            imgData[nanMask, 3] = 0
+            imgData[nanMask, dst_order[3]] = 0
 
     profile('alpha channel')
     return imgData, alpha


Test patch:
diff --git a/pyqtgraph/tests/image_testing.py b/pyqtgraph/tests/image_testing.py
--- a/pyqtgraph/tests/image_testing.py
+++ b/pyqtgraph/tests/image_testing.py
@@ -145,8 +145,13 @@ def assertImageApproved(image, standardFile, message=None, **kwargs):
         
         image = fn.imageToArray(qimg, copy=False, transpose=False)
 
-        # transpose BGRA to RGBA
-        image = image[..., [2, 1, 0, 3]]
+        # the standard images seem to have their Red and Blue swapped
+        if sys.byteorder == 'little':
+            # transpose B,G,R,A to R,G,B,A
+            image = image[..., [2, 1, 0, 3]]
+        else:
+            # transpose A,R,G,B to A,B,G,R
+            image = image[..., [0, 3, 2, 1]]
 
     if message is None:
         code = inspect.currentframe().f_back.f_code
diff --git a/pyqtgraph/tests/test_functions.py b/pyqtgraph/tests/test_functions.py
--- a/pyqtgraph/tests/test_functions.py
+++ b/pyqtgraph/tests/test_functions.py
@@ -147,6 +147,17 @@ def test_rescaleData():
                     assert np.allclose(s1, s2)
 
 
+def makeARGB(*args, **kwds):
+    img, alpha = pg.makeARGB(*args, **kwds)
+    if kwds.get('useRGBA'):         # endian independent
+        out = img
+    elif sys.byteorder == 'little': # little-endian ARGB32 to B,G,R,A
+        out = img
+    else:                           # big-endian ARGB32 to B,G,R,A
+        out = img[..., [3, 2, 1, 0]]
+    return out, alpha
+
+
 def test_makeARGB():
     # Many parameters to test here:
     #  * data dtype (ubyte, uint16, float, others)
@@ -193,55 +204,55 @@ def checkImage(img, check, alpha, alphaCheck):
     # uint8 data tests
     
     im1 = np.arange(256).astype('ubyte').reshape(256, 1)
-    im2, alpha = pg.makeARGB(im1, levels=(0, 255))
+    im2, alpha = makeARGB(im1, levels=(0, 255))
     checkImage(im2, im1, alpha, False)
     
-    im3, alpha = pg.makeARGB(im1, levels=(0.0, 255.0))
+    im3, alpha = makeARGB(im1, levels=(0.0, 255.0))
     checkImage(im3, im1, alpha, False)
 
-    im4, alpha = pg.makeARGB(im1, levels=(255, 0))
+    im4, alpha = makeARGB(im1, levels=(255, 0))
     checkImage(im4, 255-im1, alpha, False)
     
-    im5, alpha = pg.makeARGB(np.concatenate([im1]*3, axis=1), levels=[(0, 255), (0.0, 255.0), (255, 0)])
+    im5, alpha = makeARGB(np.concatenate([im1]*3, axis=1), levels=[(0, 255), (0.0, 255.0), (255, 0)])
     checkImage(im5, np.concatenate([im1, im1, 255-im1], axis=1), alpha, False)
     
 
-    im2, alpha = pg.makeARGB(im1, levels=(128,383))
+    im2, alpha = makeARGB(im1, levels=(128,383))
     checkImage(im2[:128], 0, alpha, False)
     checkImage(im2[128:], im1[:128], alpha, False)
     
 
     # uint8 data + uint8 LUT
     lut = np.arange(256)[::-1].astype(np.uint8)
-    im2, alpha = pg.makeARGB(im1, lut=lut)
+    im2, alpha = makeARGB(im1, lut=lut)
     checkImage(im2, lut, alpha, False)
     
     # lut larger than maxint
     lut = np.arange(511).astype(np.uint8)
-    im2, alpha = pg.makeARGB(im1, lut=lut)
+    im2, alpha = makeARGB(im1, lut=lut)
     checkImage(im2, lut[::2], alpha, False)
     
     # lut smaller than maxint
     lut = np.arange(128).astype(np.uint8)
-    im2, alpha = pg.makeARGB(im1, lut=lut)
+    im2, alpha = makeARGB(im1, lut=lut)
     checkImage(im2, np.linspace(0, 127.5, 256, dtype='ubyte'), alpha, False)
 
     # lut + levels
     lut = np.arange(256)[::-1].astype(np.uint8)
-    im2, alpha = pg.makeARGB(im1, lut=lut, levels=[-128, 384])
+    im2, alpha = makeARGB(im1, lut=lut, levels=[-128, 384])
     checkImage(im2, np.linspace(191.5, 64.5, 256, dtype='ubyte'), alpha, False)
     
-    im2, alpha = pg.makeARGB(im1, lut=lut, levels=[64, 192])
+    im2, alpha = makeARGB(im1, lut=lut, levels=[64, 192])
     checkImage(im2, np.clip(np.linspace(384.5, -127.5, 256), 0, 255).astype('ubyte'), alpha, False)
 
     # uint8 data + uint16 LUT
     lut = np.arange(4096)[::-1].astype(np.uint16) // 16
-    im2, alpha = pg.makeARGB(im1, lut=lut)
+    im2, alpha = makeARGB(im1, lut=lut)
     checkImage(im2, np.arange(256)[::-1].astype('ubyte'), alpha, False)
 
     # uint8 data + float LUT
     lut = np.linspace(10., 137., 256)
-    im2, alpha = pg.makeARGB(im1, lut=lut)
+    im2, alpha = makeARGB(im1, lut=lut)
     checkImage(im2, lut.astype('ubyte'), alpha, False)
 
     # uint8 data + 2D LUT
@@ -249,39 +260,39 @@ def checkImage(img, check, alpha, alphaCheck):
     lut[:,0] = np.arange(256)
     lut[:,1] = np.arange(256)[::-1]
     lut[:,2] = 7
-    im2, alpha = pg.makeARGB(im1, lut=lut)
+    im2, alpha = makeARGB(im1, lut=lut)
     checkImage(im2, lut[:,None,::-1], alpha, False)
     
     # check useRGBA
-    im2, alpha = pg.makeARGB(im1, lut=lut, useRGBA=True)
+    im2, alpha = makeARGB(im1, lut=lut, useRGBA=True)
     checkImage(im2, lut[:,None,:], alpha, False)
 
     
     # uint16 data tests
     im1 = np.arange(0, 2**16, 256).astype('uint16')[:, None]
-    im2, alpha = pg.makeARGB(im1, levels=(512, 2**16))
+    im2, alpha = makeARGB(im1, levels=(512, 2**16))
     checkImage(im2, np.clip(np.linspace(-2, 253, 256), 0, 255).astype('ubyte'), alpha, False)
 
     lut = (np.arange(512, 2**16)[::-1] // 256).astype('ubyte')
-    im2, alpha = pg.makeARGB(im1, lut=lut, levels=(512, 2**16-256))
+    im2, alpha = makeARGB(im1, lut=lut, levels=(512, 2**16-256))
     checkImage(im2, np.clip(np.linspace(257, 2, 256), 0, 255).astype('ubyte'), alpha, False)
 
     lut = np.zeros(2**16, dtype='ubyte')
     lut[1000:1256] = np.arange(256)
     lut[1256:] = 255
     im1 = np.arange(1000, 1256).astype('uint16')[:, None]
-    im2, alpha = pg.makeARGB(im1, lut=lut)
+    im2, alpha = makeARGB(im1, lut=lut)
     checkImage(im2, np.arange(256).astype('ubyte'), alpha, False)
     
     
     
     # float data tests
     im1 = np.linspace(1.0, 17.0, 256)[:, None]
-    im2, alpha = pg.makeARGB(im1, levels=(5.0, 13.0))
+    im2, alpha = makeARGB(im1, levels=(5.0, 13.0))
     checkImage(im2, np.clip(np.linspace(-128, 383, 256), 0, 255).astype('ubyte'), alpha, False)
     
     lut = (np.arange(1280)[::-1] // 10).astype('ubyte')
-    im2, alpha = pg.makeARGB(im1, lut=lut, levels=(1, 17))
+    im2, alpha = makeARGB(im1, lut=lut, levels=(1, 17))
     checkImage(im2, np.linspace(127.5, 0, 256).astype('ubyte'), alpha, False)
 
     # nans in image
@@ -289,7 +300,7 @@ def checkImage(img, check, alpha, alphaCheck):
     # 2d input image, one pixel is nan
     im1 = np.ones((10, 12))
     im1[3, 5] = np.nan
-    im2, alpha = pg.makeARGB(im1, levels=(0, 1))
+    im2, alpha = makeARGB(im1, levels=(0, 1))
     assert alpha
     assert im2[3, 5, 3] == 0    # nan pixel is transparent
     assert im2[0, 0, 3] == 255  # doesn't affect other pixels
@@ -297,7 +308,7 @@ def checkImage(img, check, alpha, alphaCheck):
     # 3d RGB input image, any color channel of a pixel is nan
     im1 = np.ones((10, 12, 3))
     im1[3, 5, 1] = np.nan
-    im2, alpha = pg.makeARGB(im1, levels=(0, 1))
+    im2, alpha = makeARGB(im1, levels=(0, 1))
     assert alpha
     assert im2[3, 5, 3] == 0    # nan pixel is transparent
     assert im2[0, 0, 3] == 255  # doesn't affect other pixels
@@ -305,7 +316,7 @@ def checkImage(img, check, alpha, alphaCheck):
     # 3d RGBA input image, any color channel of a pixel is nan
     im1 = np.ones((10, 12, 4))
     im1[3, 5, 1] = np.nan
-    im2, alpha = pg.makeARGB(im1, levels=(0, 1), useRGBA=True)
+    im2, alpha = makeARGB(im1, levels=(0, 1), useRGBA=True)
     assert alpha
     assert im2[3, 5, 3] == 0    # nan pixel is transparent