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

No transparent background in sixel #656

Closed
niksingh710 opened this issue Dec 10, 2023 · 9 comments
Closed

No transparent background in sixel #656

niksingh710 opened this issue Dec 10, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@niksingh710
Copy link

General description of bug:

  • What happened: if using sixel to show image then it is rendering a black background instead of transparent one
  • What should happen: should render a transparent background
  • Where did you get the binary: Arch linux (Aur)

image
in the image the first one is with --logo that is using symbols.

I can confirm that rendering sixel using chafa renders transparent background in terminal but in fastfetch it renders black bg.

@niksingh710 niksingh710 added the bug Something isn't working label Dec 10, 2023
@CarterLi
Copy link
Member

sixel doesn't seem to support transparent pixels. There are opening PRs in the fork repo but never got merged.

image

You should try other image protocols

@niksingh710
Copy link
Author

don't know why but for me
image
if using chafa with sixel the bg is transparent. terminal i am using is foot and tmux as multiplexer and Arch linux is the distro.

@CarterLi
Copy link
Member

Try changing the terminal background now?

@niksingh710
Copy link
Author

@CarterLi
image

@CarterLi
Copy link
Member

CarterLi commented Dec 11, 2023

Please paste the result of chafa -f sixels out.png > out.sixel here

I can confirm the behavior with foot, but not konsole and iterm...

@niksingh710
Copy link
Author

Please paste the result of chafa -f sixels out.png > out.sixel here

I can confirm the behavior with foot, but not konsole and iterm...

yep maybe the foot implementation of sixel includes patches for the bg transparency.
i am just unsure why fastfetch is rendering background is there any way that can be avoided?

@CarterLi
Copy link
Member

CarterLi commented Dec 11, 2023

Chafa uses its own sixel image convertion implementation, while fastfetch uses imagemagick. Imagemagick doesn't support transparent background for sixel and simply convert transparent pixels to black.

It's possible for fastfetch to use chafa for sixel image generation, but it seems that a lot of terminals don't support transparent backgrounds for sixel image and render a weird bg color. I don't think it's the time of switching.

It's still possible to use transparent background logos:

$ chafa -s WxH out.png > out.sixel
$ fastfetch --raw out.sixel --logo-width W --logo-height H --logo-padding-top 2 # There is a bug that makes fastfetch crash if --logo-padding-top is not set
image

@niksingh710
Copy link
Author

this hack works......

@emilrueh
Copy link

no matter what I do. the command $ fastfetch --raw out.sixel --logo-width W --logo-height H --logo-padding-top 2 # There is a bug that makes fastfetch crash if --logo-padding-top is not set does set the logo and it is in-fact transparent but alway in a size that essentially covers the entire terminal.

Neither setting the width and height in the command, nor in the config changes anything about it.

Also changing the image size to something smaller and re-running it through chafa changes anything, except for it now being massive and in rendered in terrible resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants