a python library to draw with ASCII (but with Unicode)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
799 B

  1. #!/usr/bin/env python3
  2. """
  3. Uses an image to define where to put chars.
  4. In this case with the sentence/word ASCII
  5. """
  6. from asciiWriter.patterns import image
  7. from asciiWriter.utils import make_lines, visit, print_lines
  8. from asciiWriter.marks import sentence, space
  9. width = 75
  10. height = 75
  11. # Where to find the image
  12. image_path = 'images/blobs-small.png'
  13. image_path = 'images/shapes.png'
  14. # Construct the pattern
  15. image_pattern = image(image_path)
  16. # Set the marker, in this case a sentence
  17. mark = sentence('U.R.S O.P.E.N. D.E.S.I.G.N C.O.')
  18. # Define what to use on a blank space, as a variation you coul use: single('*')
  19. blank = space()
  20. # Make a canvas
  21. lines = make_lines(width, height)
  22. # Draw the picture
  23. result = visit(lines, image_pattern, mark, blank)
  24. # Print the result
  25. print_lines(result)