@Test
public void testToINDArrayBGR() throws Exception {

    BufferedImage img = makeRandomBufferedImage(false);
    int w = img.getWidth();
    int h = img.getHeight();
    int ch = 3;
    ImageLoader loader = new ImageLoader(0, 0, ch);
    INDArray arr = loader.toINDArrayBGR(img);
    long[] shape = arr.shape();
    assertEquals(3, shape.length);
    assertEquals(ch, shape[0]);
    assertEquals(h, shape[1]);
    assertEquals(w, shape[2]);
    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            int srcColor = img.getRGB(j, i);
            int a = 0xff << 24;
            int r = arr.getInt(2, i, j) << 16;
            int g = arr.getInt(1, i, j) << 8;
            int b = arr.getInt(0, i, j) & 0xff;
            int dstColor = a | r | g | b;
            assertEquals(srcColor, dstColor);
        }
    }
}