Esempio n. 1
0
def test_conversion_color2():
    img = Image.fromGslib("tests/data/test_color.gslib")
    img.exportAsPng("tests/data/test_color.png", colored=True)
    img = Image.fromGslib("tests/data/test_color.gslib")
    img.exportAsPpm("tests/data/test_color.ppm")
    img2 = Image.fromPng("tests/data/test_color.png")
    img3 = Image.fromPpm("tests/data/test_color.ppm")
    assert np.alltrue((img.asArray()-img2.asArray()) < 1e8)
    assert img == img3
Esempio n. 2
0
def test_conversion_png_txt():
    img = Image.fromPng("tests/data/test_img.png")
    img.exportAsTxt("tests/data/test_img2.txt")
    img_test = Image.fromTxt("tests/data/test_img2.txt", (3, 3))
    assert np.alltrue(img_test == img)
Esempio n. 3
0
def test_conversion_vox_png():
    img = Image.fromVox("tests/data/test_img.vox")
    img.exportAsPng("tests/data/test_img.png")
    img_test = Image.fromPng("tests/data/test_img.png")
    assert np.alltrue(img_test == img)