small tool to transfer image between cmd char
Project description
image2char
description
this module can change image to char[], can be printed at console beautiful
-->
quick start
from image2char import tool
from PIL import Image
import logging
img_path = 'input1.jpg'
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
img = Image.open(img_path)
matrix = tool.to_chars(img, density=0.5, scale=2, reversed=True)
logging.info('matrix: %d, %d' % (len(matrix), len(matrix[0])))
for i in range(len(matrix)):
print(''.join(matrix[i]))
char_list = '''█▓▒░ '''
scanner = tool.get_scanner(density=0.5, scale=1)
scanner.scan(img, reversed=True, char_list=char_list)
scanner.print_result()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
image2char-0.0.1.tar.gz
(1.7 kB
view hashes)