tests: move bitmaptools files to their own directory

This commit is contained in:
Jeff Epler 2021-11-24 09:53:19 -06:00
parent 30c07a772f
commit ddf24772c3
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
9 changed files with 18 additions and 31 deletions

View File

Before

Width:  |  Height:  |  Size: 150 KiB

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View File

@ -0,0 +1,18 @@
import bitmaptools
import displayio
import _bmp16
if "/" in __file__:
here = __file__.rsplit("/", 1)[0]
else:
here = "."
c = displayio.Colorspace.BGR565
b1 = _bmp16.loadbmp16(here + "/minerva16.bmp")
b3 = displayio.Bitmap(320, 240, 65536)
bitmaptools.dither(b3, b1, c)
_bmp16.writebmp16(f"dither-atkinson.bmp", b3)
bitmaptools.dither(b3, b1, c, bitmaptools.DitherAlgorithm.FloydStenberg)
_bmp16.writebmp16(f"dither-floydstenberg.bmp", b3)

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

Before

Width:  |  Height:  |  Size: 150 KiB

After

Width:  |  Height:  |  Size: 150 KiB

View File

@ -1,31 +0,0 @@
import bitmaptools
import displayio
import _bmp16
if "/" in __file__:
here = __file__.rsplit("/", 1)[0]
else:
here = "."
c = displayio.Colorspace.BGR565
b1 = _bmp16.loadbmp16(here + "/minerva16.bmp")
b3 = displayio.Bitmap(320, 240, 65536)
for i in (
0,
1 / 64,
3 / 64,
3 / 32,
3 / 16,
0.5,
1 - 3 / 16,
1 - 3 / 32,
1 - 3 / 64,
1 - 1 / 64,
1,
):
bitmaptools.dither(b3, b1, c)
_bmp16.writebmp16(f"dither-atkinson.bmp", b3)
bitmaptools.dither(b3, b1, c, bitmaptools.DitherAlgorithm.FloydStenberg)
_bmp16.writebmp16(f"dither-floydstenberg.bmp", b3)