diff --git a/.gitignore b/.gitignore index d1f6803..632f7c7 100755 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ scratch.py *.bak.py *.db *.log +*.vim archive/ .vscode/ diff --git a/abots/tools/__init__.py b/abots/tools/__init__.py new file mode 100644 index 0000000..4b8c88b --- /dev/null +++ b/abots/tools/__init__.py @@ -0,0 +1 @@ +from abots.tools.pixels import make_pixels, get_random_pixels, show_pixels diff --git a/abots/tools/pixels.py b/abots/tools/pixels.py new file mode 100644 index 0000000..a9c3862 --- /dev/null +++ b/abots/tools/pixels.py @@ -0,0 +1,18 @@ +from numpy import zeros, uint8 +from PIL import Image +from random import randint + +def make_pixels(width, height): + return zeros((height, width, 3), dtype=uint8) + +def get_random_pixels(width, height): + pixels = make_pixels(width, height) + for y in range(height): + for x in range(width): + pixels[y, x] = [randint(0, 255), randint(0, 255), randint(0, 255)] + return pixels + +def show_pixels(pixels): + image = Image.fromarray(pixels) + image.show() + diff --git a/requirements.txt b/requirements.txt index bb8a97e..433dfcd 100755 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,8 @@ python-gnupg cryptography flask websockets +tensorflow +numpy +matplotlib +textblob +Pillow