Skip to main content

An tiny filter...

Project description

tinyfilter

Screenshot 2023-08-05 at 4 52 21 PM

tinyfilter [^1] is the computer vision equivalent to micrograd. It convert images into ASCII art using the principles of CNNs (convolutional neural networks).

Unlike other tools of its type, which map pixel darkness to an ASCII character, tinyfilter uses filters and convolution to detect features in an image and prints ASCII characters that correspond to them. This leads to much better results compared to other libraries for smaller images.

[^1]: For consistency, the first letter in "tinyfilter" is always lowercase, even when it begins a sentence.

Installation

To install tinyfilter locally run the command below. When installing python packages such as tinyfilter, I recommend using a virtual environment.

pip install tinyfilter

Usage

To print an image as ASCII characters using tinyfilter run the following command in your terminal. (Replace "image.png" with the name of your image.)

 tinyfilter image.png

You can also import tinyfilter inside a python file or interpreter to do the same thing:

from tinyfilter import tiny_print
tiny_print('image.png')

Why tinyfilter wins

Screenshot 2023-08-05 at 7 53 28 PM

While other python packages have features that tinyfilter doesn't yet support, tinyfilter clearly does win at one thing: recognizing the important features in an image and focusing on those. In the example above tinyfilter and Ascii-magic bother print images that are 80 columns wide. The difference is that tinyfilter's output is based on where there are edges in the image while Ascii-magic only focuses on where the image is dark and where is it bright.

Resources and sources

  • Pillow is a dependency for tinyfilter
  • numpy is a dependency for tinyfilter
  • mypy was used for type checking
  • Black was used for python code formatting

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tinyfilter-0.1.1.tar.gz (9.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tinyfilter-0.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file tinyfilter-0.1.1.tar.gz.

File metadata

  • Download URL: tinyfilter-0.1.1.tar.gz
  • Upload date:
  • Size: 9.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.1

File hashes

Hashes for tinyfilter-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9e1e8d4c0a063ff584cf4634c64f1f7a0829d3c82b39c9630ba18f052a3a1a8a
MD5 89cd8d00a4e611b9aa86dd3a562d9eea
BLAKE2b-256 7486b0728c2cdda17532982656b7d8b4e2d5bad5f605a54ac1e5118ea33ec4ef

See more details on using hashes here.

File details

Details for the file tinyfilter-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tinyfilter-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.1

File hashes

Hashes for tinyfilter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 22e2ede631055854e73a2f2fc95eb7ee62b518f184d37151cace87cbf4ee91ce
MD5 27b658ea98f37cfa6c3601430a2a87f8
BLAKE2b-256 10c1fec9a5bb8d32a6accac5eb99338171585798e786028250fc1a79a01ac608

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page