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.0.tar.gz (7.6 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.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tinyfilter-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 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.0.tar.gz
Algorithm Hash digest
SHA256 8bc8540b5df37ac159833ea10aeaa4f1e402dca0ca21c2ca6471893c3508c42c
MD5 4723e7a59ef35a552890b720132ebec1
BLAKE2b-256 84800edde31c4b51049bed922bf3315ee4450f7e49f4f697b59d443d2d3093c9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tinyfilter-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 641a7c9fc49b1cc328a4a40049c0652192b54ad6f85aaa5f9db45ce8921cb779
MD5 4caebfa110ccec326b148832a3a25481
BLAKE2b-256 0638eaa2c8780c4c9cfd9aee93698192a1af73f26d7b65fc5af8f13a528baf75

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