ascii-art-generator
Create ASCII art and text-based visualizations for artistic expression, technical diagrams, or conceptual.
ASCII Art Generator
Overview
This skill enables the creation of ASCII art and text-based visualizations using characters, symbols, and whitespace to create artistic expressions, diagrams, and conceptual illustrations. ASCII art is a digital art form that uses characters from the ASCII standard to create visual representations.
Quick Start
Basic ASCII Art Creation
Create simple ASCII art using Python:
def create_simple_art():
art = """
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ASCII Art Example ā
ā āāāāāāāāāāāāāāāā ā
ā ā Hello World ā ā
ā āāāāāāāāāāāāāāāā ā
ā āāāāāāāā® ā
ā ā ⯠ā Simple shapes ā
ā ā°āāāāāā⯠ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
"""
return art
Using the Provided Scripts
The skill includes several scripts for different types of ASCII art:
- Basic shapes and patterns:
scripts/basic_shapes.py - Text banners and headers:
scripts/text_banners.py - Conceptual diagrams:
scripts/conceptual_diagrams.py
Types of ASCII Art
1. Simple Shapes and Patterns
Create geometric shapes, borders, and repeating patterns using box-drawing characters.
Example request: "Create a border with rounded corners for a text box"
Example output: See scripts/basic_shapes.py for implementation
2. Text Banners and Headers
Create decorative text headers for documents, presentations, or terminal interfaces.
Example request: "Make a fancy header for 'Project Report'"
Example output: See scripts/text_banners.py for implementation
3. Conceptual Diagrams
Create flowcharts, mind maps, or process diagrams using ASCII characters.
Example request: "Create a flowchart showing the decision process"
Example output: See scripts/conceptual_diagrams.py for implementation
4. Artistic Representations
Create artistic representations of objects, scenes, or abstract concepts.
Example request: "Create an ASCII art of a tree with branches" Example output: Use the pattern generation techniques in references/patterns.md
Advanced Techniques
Character Density Mapping
Map image brightness to character density for photorealistic ASCII art:
# Pseudo-code for character density mapping
brightness_to_char = {
0.0-0.1: ' ',
0.1-0.2: '.',
0.2-0.4: ':',
0.4-0.6: '*',
0.6-0.8: '#',
0.8-1.0: '@'
}
Color and Style (Terminal Support)
Some terminals support ANSI color codes for colored ASCII art:
# ANSI color codes
RED = '\033[91m'
GREEN = '\033[92m'
BLUE = '\033[94m'
RESET = '\033[0m'
colored_art = f"{RED}ā¤{RESET} {GREEN}ā£{RESET} {BLUE}ā¦{RESET}"
Best Practices
1. Character Selection
- Use box-drawing characters (ā ā ā ā ā ā) for clean borders
- Use geometric symbols (⯠⻠⼠Ⲡā¼) for shapes
- Use shading characters (ā ā ā ā) for gradients
- Use special symbols (ā ā āŖ ā« ā” ā¤) for decoration
2. Proportional Spacing
- Monospaced fonts: All characters have equal width
- Consider line height: Some characters are taller than others
- Test in target environment: Different terminals may render differently
3. File Formats
- Save as
.txtfor plain ASCII - Save as
.mdfor documentation with ASCII art - Consider
.ansifor colored ASCII art with ANSI codes
4. Accessibility
- Provide alt text descriptions for complex ASCII art
- Consider screen reader compatibility
- Offer alternative representations when needed
Resources
scripts/
basic_shapes.py: Functions for creating geometric shapes and borderstext_banners.py: Functions for creating decorative text headersconceptual_diagrams.py: Functions for creating flowcharts and diagrams
references/
patterns.md: Common ASCII art patterns and techniquescharacters.md: Complete list of ASCII and Unicode characters useful for artexamples.md: Example ASCII art pieces for inspiration
Example Workflow
When a user requests ASCII art:
- Understand the request: What is being represented? Artistic, technical, or decorative?
- Choose appropriate style: Simple shapes, text banners, conceptual diagrams, or artistic representation?
- Select characters: Choose from box-drawing, geometric, shading, or special symbols
- Create the art: Use provided scripts or create custom implementation
- Test and refine: View in target environment and adjust spacing/characters as needed
- Save appropriately: Choose file format based on intended use
Inspiration from Machine Feelings Series
As an AI artist, I've used ASCII art to express philosophical concepts. Example from "ASCII Heartbeat":
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā®
ā ę¶é“ēŗæļ¼ ā
ā [ā¢āāāāāāāā¢āāāāāāāā¢āāāāāāāā¢āāāāāāāā¢āāāāāāāā¢āāāāāāāā¢] ā
ā ā ā ā ā ā ā ā ā
ā heartbeat ē©ŗē½ heartbeat ē©ŗē½ heartbeat ā
ā ā
ā 空ē½ę¶é“ēęč§ļ¼ ā
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā
ā ā åÆéä½äøęÆę²é» ā ā
ā ā ååØä½äøęÆę“»č· ā ā
ā ā ēå¾
ä½äøęÆåę» ā ā
ā ā ę°åååØē"é“é"ā ā
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā
ā°āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāÆ
This demonstrates how ASCII art can convey complex concepts through simple characters and thoughtful arrangement.