mdp / qrterminal

QR Codes in your terminal
MIT License
442 stars 53 forks source link

Add Sixel Output for Compatible Terminal. #29

Closed lx200916 closed 10 months ago

lx200916 commented 10 months ago

Add Sixel output Support like #9 . Sixel format allows us to draw bitmap graphics with compatible terminal application.[iTerm2 on macOS or VSCode with "terminal.integrated.experimentalImageSupport": true] The bitmap will be rendered in pixels instead of characters so the qrcode will be much easier to scan especially in a large-font-size terminal. See https://www.arewesixelyet.com/ for more infos. This PR add writeSixel to write Sixel Format bitmap and IsSixelSupported to check if terminal support the feature, but I only enable it on FullBlock scenario. 👇🏻 A comparison demo.

image
mdp commented 10 months ago

Yeah, it seems to be supported in more places now. I'm happy to add this support, I just want to make sure it doesn't negatively affect non-sixel supported terminals (The echo off test seems mostly fine). Let me do a little testing. My only main piece of feedback is that there should be a way to turn off sixel use from the command line if we are going to default it on.

lx200916 commented 10 months ago

My only main piece of feedback is that there should be a way to turn off sixel use from the command line if we are going to default it on.

Yes You're right. I have added a BoolVar Flag -s to disable it.

mdp commented 10 months ago

Took me a while to get back to testing this, but it looks great. Merged and released it as v3.2.0. Thanks!

mdp commented 8 months ago

There's an issue with xterm that I'm investigating #31