atanunq / viu

Terminal image viewer with native support for iTerm and Kitty
MIT License
2.5k stars 54 forks source link

Allow setting background color for transparent images #93

Open jpmvferreira opened 2 years ago

jpmvferreira commented 2 years ago

In #10 it was proposed to add a transparent background to transparent pictures. This is very cool, unless when the image has more or less the same color has the background. Currently viu has a -t, --transparent flag, which claims to 'Display transparent image with transparent background', however, this is the default case (at least for me, and I've just re-built viu today) which means this flag isn't doing anything.

Would it be possible to obtain the checker board like pattern for a transparent picture (either by default or with a custom flag) and/or set a custom background color when viewing transparent images (maybe with a custom flag and supply it with a given color)?

i30817 commented 2 years ago

Ah, -t does something now, or at least in terminals that aren't kitty, like xterm.

Without it, the image transparent parts show in checkboard pattern.