emsquid / pic

Preview Image in CLI.
MIT License
57 stars 4 forks source link

Support alternative to writing directly to stdin #11

Open bogzbonny opened 1 year ago

bogzbonny commented 1 year ago

As much as I'd like to use pic as a library I've been unable to as pic within my CUI as it writes directly to stdin instead of allowing the caller of the library to decide how/when/where to write the graphic-escape-codes

For instance in my program I have a buffer which I flush once in a while which I write to ahead of time. If pic, under some feature flag, returned the string that it would normally be writing to stdin and which would allowed the caller of the library to process it I'd be able to successfully integrate it into my program.

Just an idea. I've ended up reimplemented a lot of the kitty image protocol for my own usage, would be a cool feature I reckon!

emsquid commented 1 year ago

Actually this is a good idea but it wouldn't work for all the protocols sadly, I can't do that with sixels as far as I know (unless I find another method, I will try to see). I will think about it and find a cool way of implementing that!

emsquid commented 1 year ago

From my little research I should be able to get that working even for sixel, I'll be working on that soon!!!