All Projects → kelvindecosta → Picharsso

kelvindecosta / Picharsso

Licence: mit
🎨 A utility for converting images to text art.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Picharsso

Ascii art
Real-Time ASCII Art Rendering Library
Stars: ✭ 599 (+499%)
Mutual labels:  image-processing, ascii-art
Bkasciiimage
Convert UIImage to ASCII art
Stars: ✭ 421 (+321%)
Mutual labels:  image-processing, ascii-art
Imgtoascii
A JavaScript implementation of a image to Ascii code
Stars: ✭ 331 (+231%)
Mutual labels:  image-processing, ascii-art
Logorain Ascii Art
Logorain-ASCII-Art: A simple Image to ASCII Art converter
Stars: ✭ 24 (-76%)
Mutual labels:  image-processing, ascii-art
Pimg
📷 Mini Image Lazy Loader for P(R)eact and Vue
Stars: ✭ 97 (-3%)
Mutual labels:  image-processing
Dped
Software and pre-trained models for automatic photo quality enhancement using Deep Convolutional Networks
Stars: ✭ 1,315 (+1215%)
Mutual labels:  image-processing
Cropperjs
JavaScript image cropper.
Stars: ✭ 10,120 (+10020%)
Mutual labels:  image-processing
Connected Components 3d
Connected components on multilabel 3D & 2D images. Handles 26, 18, and 6 connected variants.
Stars: ✭ 90 (-10%)
Mutual labels:  image-processing
Glide Transformations
An Android transformation library providing a variety of image transformations for Glide.
Stars: ✭ 9,540 (+9440%)
Mutual labels:  image-processing
Sign Language Recognition
✌️ 👌 ✊ 📷 Sign Language Recognition using Python
Stars: ✭ 98 (-2%)
Mutual labels:  image-processing
Augmentor.jl
A fast image augmentation library in Julia for machine learning.
Stars: ✭ 95 (-5%)
Mutual labels:  image-processing
Retrotxt
RetroTxt is the WebExtension that turns ANSI, ASCII, NFO text into in-browser HTML
Stars: ✭ 93 (-7%)
Mutual labels:  ascii-art
Ransac 2d Shape Detection
line, circle and ellipse detection in 2d images.
Stars: ✭ 97 (-3%)
Mutual labels:  image-processing
Pyautolens
PyAutoLens: Open Source Strong Gravitational Lensing
Stars: ✭ 90 (-10%)
Mutual labels:  image-processing
Imghash
Perceptual image hashing for Node.js
Stars: ✭ 98 (-2%)
Mutual labels:  image-processing
Mocogan
A pytorch implemention of MoCoGAN
Stars: ✭ 90 (-10%)
Mutual labels:  image-processing
Retina Features
Project for segmentation of blood vessels, microaneurysm and hardexudates in fundus images.
Stars: ✭ 95 (-5%)
Mutual labels:  image-processing
Traffic Sign Detection
Traffic signs detection and classification in real time
Stars: ✭ 96 (-4%)
Mutual labels:  image-processing
Image To Ascii
💾 A Node.js module that converts images to ASCII art.
Stars: ✭ 1,328 (+1228%)
Mutual labels:  ascii-art
Androidwm
An android image watermark library that supports steganography.
Stars: ✭ 1,322 (+1222%)
Mutual labels:  image-processing

Picharsso


A utility for converting images to text art.
PyPI - Status pypi package GitHub

Installation    |    Documentation    |    Examples    |    Contributing

Installation

Run the following command:

pip install picharsso

This will:

  • download and install the picharsso Python package (along with its dependencies).
  • create an executable, picharsso, for the CLI (command line interface).

Verification

To verify that Picharsso is installed, run:

python -c "import picharsso"

Commands

Picharsso ships with a CLI that provides some basic functionality from the terminal.

Usage

Run the following command to display a helpful message:

picharsso -h
Usage: picharsso [options] <command> [args]

  A utility for converting images to text art.

Options:
  -h, --help  Show this message and exit.

Commands:
  draw  Generate text art from an image.
  info  Displays package information.

Consider the following image:

Apple logo

Apple Computer [Rob Janoff, 1977]

To convert an image to text art, run:

picharsso draw -c -H 32 <path/to/image> gradient

Here's what it should look like:

Apple logo in text (gradient style)

Breakdown

Argument Effect
-c Apply image colors to the output text.
-H 32 Sets the number of lines of the output text to 32.
gradient Use the gradient style.

Don't forget to replace <path/to/image>.

Refer to the CLI documentation to learn about the various commands and arguments.

Library

The example from the previous section can be implemented in just a few lines of Python:

from PIL import Image
from picharsso import new_drawer

if __name__ == "__main__":
    # Open image
    image = Image.open("<path/to/image>")

    # Define drawer
    drawer = new_drawer("braille", height=32, colorize=True)

    # Print drawer output
    print(drawer(image))

Here's what it should look like:

Apple logo in text (Braille style)

Styles

Refer to the Styles documentation for an in-depth guide to the image processing behind Picharsso.

Now consider this animated GIF:

Nyan Cat

Nyan Cat

With some more lines of code, you can animate GIFs in text!

import time

from PIL import Image
from picharsso import new_drawer
from picharsso.utils import clear_screen, terminal_size


if __name__ == "__main__":
    # Open image
    image = Image.open("<path/to/image>")

    # Get terminal height
    height, _ = terminal_size()

    # Define drawer
    drawer = new_drawer("braille", height=height, colorize=True, threshold=0)

    # Iterate over frames
    texts = []
    for frame_id in range(image.n_frames):
        # Select frame
        image.seek(frame_id)

        # Save output for frame
        texts.append(drawer(image))

    # Iterate over saved outputs in a circular manner
    num_frames = len(texts)
    counter = 0
    while True:
        # Refresh
        clear_screen()

        # Print output
        print(texts[counter])

        # Set a delay between frames
        time.sleep(1 / num_frames)

        # Circular increment
        counter = (counter + 1) % num_frames

Here's what it should look like:

Nyan Cat in text (Braille style)

Refer to the API documentation to learn about the various classes and functions.

Examples

Check out some more examples.

You can use an image directly from the web too!

Contributing

Do you have a feature request, bug report, or patch? Great! Check out the contributing guidelines!

License

Copyright (c) 2019 Kelvin DeCosta. Released under the MIT License. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].