TerminalImageViewer icon indicating copy to clipboard operation
TerminalImageViewer copied to clipboard

Transparency support for PNG

Open tryadelion opened this issue 5 years ago • 8 comments

there seems to be no support for alpha channel on PNG's / Gifs, is that a possibility? atleast on fully transparent rgba(0,0,0,0) pixels.

tryadelion avatar May 19 '20 00:05 tryadelion

I don't think that is as this project uses unicode half-block characters, and I don't think there is a transparent half block character. If we use unicode invisible characters, we can't really promise on the spacing.

aaronliu0130 avatar May 31 '20 08:05 aaronliu0130

how about U+2591 for 0-alpha? it wouldnt look solid, atleast

tryadelion avatar May 31 '20 10:05 tryadelion

We can't access / preserve the terminal background. We could add support for a user-specified "background" color though.... Perhaps default to the common gray/gray checkerboard pattern?

stefanhaustein avatar May 31 '20 13:05 stefanhaustein

how about U+2591 for 0-alpha? it wouldnt look solid, atleast

Yes, that Unicode character sure doesn't work well on my terminal emulator. See the screenshot below. Ignore the cow.

aaronliu0130 avatar Jun 01 '20 11:06 aaronliu0130

@stefanhaustein maybe sth like this? https://stackoverflow.com/questions/43931304/is-it-possible-to-determine-the-background-color-of-the-terminal-in-a-linux-mach

tryadelion avatar Jun 01 '20 11:06 tryadelion

Not sure how accessible the shell variable would be from cross-platform c++... if not, an explicit command line parameter would still help to pass it over... So I think it makes sense to start with that and then take it from there....

stefanhaustein avatar Jun 01 '20 12:06 stefanhaustein

Well, usage of system() is considered to be not good, but since we don't have any other options lets just take it from here. I'm not sure if that shell script is cross-terminal though...

aaronliu0130 avatar Jun 01 '20 12:06 aaronliu0130

I can test on some terminals mac and debian, mint and a couple more if necessary

tryadelion avatar Aug 12 '20 14:08 tryadelion