1from base64 import encode_bytes
2from os import STDOUT
3from os import Stdout
4
5func write(image: bytes):
6 """Write given image to the terminal.
7
8 """
9
10 STDOUT.write(f"\x1b]1337;File=size={image.length()};inline=1:".to_utf8())
11 STDOUT.write(encode_bytes(image))
12 STDOUT.write(b"\a")