televex/screen/tools/ascii-art-but-with-unicode/image_sentence.py

31 lines
799 B
Python

#!/usr/bin/env python3
"""
Uses an image to define where to put chars.
In this case with the sentence/word ASCII
"""
from asciiWriter.patterns import image
from asciiWriter.utils import make_lines, visit, print_lines
from asciiWriter.marks import sentence, space
width = 75
height = 75
# Where to find the image
image_path = 'images/blobs-small.png'
image_path = 'images/shapes.png'
# Construct the pattern
image_pattern = image(image_path)
# Set the marker, in this case a sentence
mark = sentence('U.R.S O.P.E.N. D.E.S.I.G.N C.O.')
# Define what to use on a blank space, as a variation you coul use: single('*')
blank = space()
# Make a canvas
lines = make_lines(width, height)
# Draw the picture
result = visit(lines, image_pattern, mark, blank)
# Print the result
print_lines(result)