from context import ascii_magic img = ascii_magic.from_image_file('lion.jpg', columns=200, width_ratio=2.5, mode=ascii_magic.Modes.ASCII) print(img)
from context import ascii_magic ascii_art = ascii_magic.from_image_file('lion.jpg', columns=200, mode=ascii_magic.Modes.HTML) markup = f"""<!DOCTYPE html> <html> <body style="background-color: black; font-size: 8px;"> <pre> {ascii_art} </pre> </body> </html>""" with open('output_html.html', 'w') as f: f.write(markup)
from context import ascii_magic ascii_magic.to_terminal( ascii_magic.from_image_file('lion.jpg', columns=200, width_ratio=2.5, back=ascii_magic.Back.BLUE))
from context import ascii_magic ascii_art = ascii_magic.from_image_file('kid.jpg', columns=200, mode=ascii_magic.Modes.HTML_TERMINAL) markup = f"""<!DOCTYPE html> <html> <body style="background-color: black; font-size: 8px;"> <pre> {ascii_art} </pre> </body> </html>""" with open('output_html-terminal.html', 'w') as f: f.write(markup)
from context import ascii_magic output = ascii_magic.from_image_file('nope.jpg') ascii_magic.to_terminal(output)
from context import ascii_magic output = ascii_magic.from_image_file('kid.jpg', columns=200, mode=ascii_magic.Modes.HTML) ascii_magic.to_html_file('kid.html', output, auto_open=True)
from context import ascii_magic from_file = ascii_magic.from_image_file('chicken_transparent.png') ascii_magic.to_terminal(from_file)
from context import ascii_magic from_file = ascii_magic.from_image_file('kid.jpg', columns=100, width_ratio=2.6, char='#') ascii_magic.to_terminal(from_file)