images + artistic effects
- Argparse
- Pillow
python setup.py install
python setup.py test
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)
- Test Image: Triceratops Skull Cast - MathKnight/CC BY-SA 4.0
im2a ~/Desktop/tri.jpg
# NOTE: --ascii is default
im2a --text ~/Desktop/tri.jpg
im2a --dots ~/Desktop/tri.jpg
im2a --polygon --size 40 --sides 9 --rotation 45 ~/Desktop/tri.jpg
# Options: pixel block size 40px / 9-sided polygons / rotated 45deg
- Make a scan object with Im2Scan.
- 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)
- Run save().
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()
- Image Path
- Any image file that can be read with Pillow.
- Block Size
- Size of pixel area that is scanned.
- Default 10 (10px by 10px).
- Character List
- Optional Array or Tuple of characters arranged from dark to light.
- Default ("#", "$", "*", "!", "'", " ").