Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Support transparency #5

Closed
torrobinson opened this issue Mar 3, 2022 · 4 comments
Closed

Suggestion: Support transparency #5

torrobinson opened this issue Mar 3, 2022 · 4 comments

Comments

@torrobinson
Copy link

Just a suggestion: if the imported image has a pixel with any amount of transparency, it'd be cool if that pixel translated to an empty character or space when being output to the console - this would allow small icons or pngs with a transparent background to render without a black box around them.

@torrobinson torrobinson changed the title Suggestion: support transparency Suggestion: Support transparency Mar 5, 2022
@NotNotWrongUsually
Copy link
Owner

Currently working on supporting proper alpha blending. WIP example here: https://imgur.com/a/VW44aNz

Alas, sometimes the kingdom is lost for want of a nail. In order to do proper blending I have to know the current background colour of the terminal. Powershell itself will report the console colour, but the actual colour is only know to the terminal application. It should be retrievable with ANSI escape codes, but the relevant ones are not implemented in the Windows console yet (microsoft/terminal#3718).

Going to mull over this for a little longer.

@torrobinson
Copy link
Author

I think I also looked into this a year ago and gave up very quickly 😆

I suppose at worst, if blending is enabled via a parameter, you could force the user to also provide the known background color as a parameter, but that might be too clunky.

Interested to see what you come up with!

@NotNotWrongUsually
Copy link
Owner

I've done exactly that in the current "positioning" branch. Can force a transparency color by parameter, or it will just default to my console background right now (works on my machine!). This is the One Half Dark theme from Windows Terminal, so it will work for at least a tiny amount of other people too without setting anything! It is basically a placeholder while I try to figure out some way to get the terminal background color. Not too hopeful on that right now.

It will automatically detect if blending is relevant, and only apply it where useful, so there is no parameter on whether to activate it or not.

@NotNotWrongUsually
Copy link
Owner

Merged, and released on the gallery as v.1.6. I'll watch for Terminal getting update with proper support for retrieving bg colour via OSC calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants