dankamongmen / notcurses

blingful character graphics/TUI library. definitely not curses.
https://nick-black.com/dankwiki/index.php/Notcurses
Other
3.46k stars 112 forks source link

restore iTerm2/PNG code #2077

Open dankamongmen opened 3 years ago

dankamongmen commented 3 years ago

in #2060, we removed the iTerm2 code, and the PNG code upon which it depended. @gnachman has since decided that graphic-on-glyph will be supported by iTerm2 work, hopefully later this year. let's go ahead and add that stuff back, finish out the wipe/restore cycle, and have it prepped and ready to do.

@klamonte mentioned that providing inline worked around the file-save prompt, which would be desirable.

dankamongmen commented 3 years ago

this might be a good place to introduce mosaics. @gnachman, i've been wanting to experiment with breaking images up into cell-sized regions. thus say a 1000x1000 image would, on a cell-pixel geometry 20 pixels high and 10 pixels wide, become 500 10x20 images. this would (perhaps counter-intuitively) greatly simplify a lot of logic. is iTerm2 in shape to handle that many concurrent graphics, or would it be a bad terminal to start this experiment with?

if we can do mosaics on iTerm2, we of course needn't introduce the wipe/restore code, so this might be a wash with regards to implementation complexity -- but then we could start using it for other protocols.

gnachman commented 3 years ago

I have a 16 bit index into the image table. 500 images is fine. 32768 is where you'll run in to trouble.

dankamongmen commented 3 years ago

I have a 16 bit index into the image table. 500 images is fine. 32768 is where you'll run in to trouble.

beautiful! that would handle up to a full-screen 256x128-cell image, which is pretty big =]. well, @gnachman , sounds like you just volunteered to be the testbed for mosaics =]. how exciting!

dankamongmen commented 3 years ago

mosaics background: #1422, #184, #1655, #1563

ghost commented 2 years ago

How far away is the iTerm2 output code from being re-integrable? If the API hasn't changed much, I might try to contribute it back for you.

I'm curious because using PNG files for transparency would work, and could look quite cool. I used PNG (jexer image format rather than iTerm2, but same deal) and got this.

dankamongmen commented 2 years ago

@klamonte if i recall correctly, PNG with transparency weren't displayed with transparency in iterm2. let me consult my notes.

dankamongmen commented 2 years ago

@klamonte see #2060 and #1987 prior to that. the png+iterm2 buildout was working reasonably well, but i never really hammered on it, because it did not support transparency even when provided a (partially-)transparent PNG. with that, it became uninteresting to me.

note that the iterm2 author is planning to add the necessary support. should that land, i'll be digging that code back out (or possibly just driving it through sixel, as i do on iterm2 now).