示例#1
0
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

output = ascii_magic.from_url(
    'https://wow.zamimg.com/uploads/blog/images/20516-afterlives-ardenweald-4k-desktop-wallpapers.jpg'
)
ascii_magic.to_terminal(output)
示例#3
0
from context import ascii_magic
from PIL import Image

with Image.open('kid.jpg') as img:
    from_image = ascii_magic.from_image(img,
                                        columns=100,
                                        width_ratio=2.6,
                                        char='#')

ascii_magic.to_terminal(from_image)
示例#4
0
from context import ascii_magic

from_url = ascii_magic.from_url('https://source.unsplash.com/800x600?nature', columns=50, char='@')
ascii_magic.to_terminal(from_url)
示例#5
0
from context import ascii_magic

from_file = ascii_magic.from_image_file('chicken_transparent.png')
ascii_magic.to_terminal(from_file)