Coder Social home page Coder Social logo

im2a-py's Introduction

im2a

images + artistic effects

Requirements

  • Argparse
  • Pillow

Install

python setup.py install
python setup.py test

Command Line Usage

im2a [option flags] [one or more paths] 
    --ascii (default type, outputs to text file instead of making a PNG)
    --block (grayscale blocks)
    --dots (scaled grayscale circles)
    --text (grayscale text characters)
    --polygon (grayscale n-sides polygons with rotation. default 8 sides, no rotation)
    --size (optional pixel block size, default 10)
    --sides (optional for polygon) 
    --rotation (optional for polygon)

Command Line Examples

1. Ascii (Text File)
im2a ~/Desktop/tri.jpg
# NOTE: --ascii is default

im2a example 1


2. Text (PNG Image)
im2a --text ~/Desktop/tri.jpg

im2a example 2


3. Dots (PNG Image)
im2a --dots ~/Desktop/tri.jpg

im2a example 3


4. Polygon (PNG Image)
im2a --polygon --size 40 --sides 9 --rotation 45  ~/Desktop/tri.jpg
# Options: pixel block size 40px / 9-sided polygons / rotated 45deg

im2a example 4


Class Usage

  1. Make a scan object with Im2Scan.
  2. Add scan object to one of the output classes.
    • Im2Ascii (Ascii Text File)
    • Im2Block (Image as Blocks of Gray)
    • Im2Dots (Image as Dots of Gray)
    • Im2Text (Image as Text Characters)
    • Im2Polygon (Image as N-Sided Polygon with Rotation)
      • Takes 2 extra options (size and rotation)
  3. Run save().

Class Example

import im2a
scan = im2a.Im2Scan(img=<path location>, 
               block_size=<size (default = 10)>, 
               char_list=[array of characters (optional)])
output = im2a.Im2Ascii(scan)
output.save()

Scan Options

  1. Image Path
    • Any image file that can be read with Pillow.
  2. Block Size
    • Size of pixel area that is scanned.
    • Default 10 (10px by 10px).
  3. Character List
    • Optional Array or Tuple of characters arranged from dark to light.
    • Default ("#", "$", "*", "!", "'", " ").

im2a-py's People

Contributors

jaschon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.