[GH-ISSUE #122] feature request: sixel support #986

Closed
opened 2026-03-14 12:50:31 +03:00 by kerem · 20 comments
Owner

Originally created by @justchokingaround on GitHub (Feb 7, 2023).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/122

Currently spotify-player (which is amazing, I daily drive it tysm) supports the iTerm2 and Kitty image protocols. It would be great to also have sixel support, which is available on more terminal emulators. Here's a (maybe) useful ressource, for implementing this https://github.com/Siriusmart/youtube-tui/blob/master/src/items/iteminfo.rs

Originally created by @justchokingaround on GitHub (Feb 7, 2023). Original GitHub issue: https://github.com/aome510/spotify-player/issues/122 Currently `spotify-player` (which is amazing, I daily drive it tysm) supports the iTerm2 and Kitty image protocols. It would be great to also have sixel support, which is available on more terminal emulators. Here's a (maybe) useful ressource, for implementing this https://github.com/Siriusmart/youtube-tui/blob/master/src/items/iteminfo.rs
kerem 2026-03-14 12:50:31 +03:00
Author
Owner

@aome510 commented on GitHub (Feb 7, 2023):

Hi @justchokingaround, ty for your interest in this project. The library I use to implement image rendering already supports sixel (behind a feature flag), so adding sixel support should not be too difficult.

Also thanks for the example implementation, I'll take a look when implementing the support later.

<!-- gh-comment-id:1421399587 --> @aome510 commented on GitHub (Feb 7, 2023): Hi @justchokingaround, ty for your interest in this project. The [library](https://github.com/atanunq/viuer) I use to implement image rendering already supports `sixel` (behind a feature flag), so adding `sixel` support should not be too difficult. Also thanks for the example implementation, I'll take a look when implementing the support later.
Author
Owner

@justchokingaround commented on GitHub (Feb 7, 2023):

thx :)

<!-- gh-comment-id:1421403074 --> @justchokingaround commented on GitHub (Feb 7, 2023): thx :)
Author
Owner

@aome510 commented on GitHub (Feb 15, 2023):

@justchokingaround can you build the app in https://github.com/aome510/spotify-player/pull/134 and try to run the terminal with sixel support [1] to see if the new changes work? I couldn't test it as I don't have access to such terminals.

[1]: please note that the list of supported terminals is actually limited by viuer library:
github.com/atanunq/viuer@dc81f44a97/src/printer/sixel.rs (L83-L95)
but I still think the list can be expanded by making a PR on viuer repo.

<!-- gh-comment-id:1430750294 --> @aome510 commented on GitHub (Feb 15, 2023): @justchokingaround can you build the app in https://github.com/aome510/spotify-player/pull/134 and try to run the terminal with `sixel` support [1] to see if the new changes work? I couldn't test it as I don't have access to such terminals. [1]: please note that the list of supported terminals is actually limited by `viuer` library: https://github.com/atanunq/viuer/blob/dc81f44a97727e04be0b000712e9233c92116ff8/src/printer/sixel.rs#L83-L95 but I still think the list can be expanded by making a PR on `viuer` repo.
Author
Owner

@justchokingaround commented on GitHub (Feb 15, 2023):

image

image

this is using the foot terminal

<!-- gh-comment-id:1431472863 --> @justchokingaround commented on GitHub (Feb 15, 2023): ![image](https://user-images.githubusercontent.com/44473782/219057889-db890ec9-c13b-4b79-aae3-c8cde1391b2f.png) ![image](https://user-images.githubusercontent.com/44473782/219058268-d398357d-8162-42cf-a155-b5c8695ee045.png) this is using the foot terminal
Author
Owner

@aome510 commented on GitHub (Feb 15, 2023):

This doesn't look like running with image feature. Did you run cargo run --features image?

<!-- gh-comment-id:1431480493 --> @aome510 commented on GitHub (Feb 15, 2023): This doesn't look like running with `image` feature. Did you run `cargo run --features image`?
Author
Owner

@justchokingaround commented on GitHub (Feb 15, 2023):

no, i forgot about the flag, sorry
image

<!-- gh-comment-id:1431484238 --> @justchokingaround commented on GitHub (Feb 15, 2023): no, i forgot about the flag, sorry ![image](https://user-images.githubusercontent.com/44473782/219060479-90c5f653-69f6-4099-8bdc-7d0c257a41e7.png)
Author
Owner

@aome510 commented on GitHub (Feb 15, 2023):

Thanks, now it looks really weird =))). I'll try to install foot today and test it.

<!-- gh-comment-id:1431488057 --> @aome510 commented on GitHub (Feb 15, 2023): Thanks, now it looks really weird =))). I'll try to install foot today and test it.
Author
Owner

@aome510 commented on GitHub (Feb 15, 2023):

@justchokingaround can you try it again with the new changes? After adding some custom scaling, it seems to work now on my foot terminal. By any chance, do you have other terminals that also support sixel? I'm unsure if this scaling issue is because of foot or the viuer library's implementation of sixel.

<!-- gh-comment-id:1431827020 --> @aome510 commented on GitHub (Feb 15, 2023): @justchokingaround can you try it again with the new changes? After adding some custom scaling, it seems to work now on my `foot` terminal. By any chance, do you have other terminals that also support `sixel`? I'm unsure if this scaling issue is because of `foot` or the `viuer` library's implementation of `sixel`.
Author
Owner

@justchokingaround commented on GitHub (Feb 15, 2023):

here is foot after pulling latest changes (doesn't work properly):
image

yes, i do (list of terminal that support sixel: https://www.reddit.com/r/linux/comments/t3m7zm/quick_roundup_of_bitmap_graphics_availability_in/ )

here is wezterm (might be using the kitty protocol):
image

here is xterm (doesn't work properly):
image

here is alacritty with sixel patch (doesn't work properly):
image
in alacritty viu seems to be rendering blocks for images, but it works fine in term

viu in patched alacritty:
image

viu in foot:
image

an alternative rust program, which will soon be also made into a rust library (i've talked with the creator) is pic: https://github.com/emsquid/pic

here's an example of it in patched alacritty:
image

and in foot:
image

it supports width, height, position args etc
it might probably be tedious at this point to switch over to it for displaying images, but i'm just sharing what i know in case that might be helpful

<!-- gh-comment-id:1431848893 --> @justchokingaround commented on GitHub (Feb 15, 2023): here is foot after pulling latest changes (doesn't work properly): ![image](https://user-images.githubusercontent.com/44473782/219121925-6154f60f-3658-481e-b1e0-c50063009ea7.png) yes, i do (list of terminal that support sixel: https://www.reddit.com/r/linux/comments/t3m7zm/quick_roundup_of_bitmap_graphics_availability_in/ ) here is wezterm (might be using the kitty protocol): ![image](https://user-images.githubusercontent.com/44473782/219122523-7ccf6ee8-c2ee-4058-956a-cb52cf4e6902.png) here is xterm (doesn't work properly): ![image](https://user-images.githubusercontent.com/44473782/219122772-3eb36cb3-b251-405b-84fe-6122062b8f8c.png) here is alacritty with sixel patch (doesn't work properly): ![image](https://user-images.githubusercontent.com/44473782/219123156-3ebffd7d-7235-45b7-9775-b5f270e4ed5b.png) in alacritty viu seems to be rendering blocks for images, but it works fine in term viu in patched alacritty: ![image](https://user-images.githubusercontent.com/44473782/219123438-52346106-c7c2-4536-b518-c53464c0fc4e.png) viu in foot: ![image](https://user-images.githubusercontent.com/44473782/219123517-3def3a4d-ca0b-4e68-83e9-c7ff2ecd7d9b.png) an alternative rust program, which will soon be also made into a rust library (i've talked with the creator) is pic: https://github.com/emsquid/pic here's an example of it in patched alacritty: ![image](https://user-images.githubusercontent.com/44473782/219123863-9f5939d9-6199-415b-b9d1-2af97f2ef58e.png) and in foot: ![image](https://user-images.githubusercontent.com/44473782/219123906-d75bc2b9-db7e-4737-8e8c-6664dbaea5df.png) it supports width, height, position args etc it might probably be tedious at this point to switch over to it for displaying images, but i'm just sharing what i know in case that might be helpful
Author
Owner

@aome510 commented on GitHub (Feb 15, 2023):

@justchokingaround oh I forgot to tell you that about the different feature for sixel, so you should run cargo run --features sixel instead of --features image. Tysm for all the experiments, can you try again and update the images?

<!-- gh-comment-id:1431860280 --> @aome510 commented on GitHub (Feb 15, 2023): @justchokingaround oh I forgot to tell you that about the different feature for `sixel`, so you should run `cargo run --features sixel` instead of `--features image`. Tysm for all the experiments, can you try again and update the images?
Author
Owner

@justchokingaround commented on GitHub (Feb 15, 2023):

np
here is foot:
image

here is wezterm:
image

and here is patched alacritty lol:
image

height and width variables are unused:
image

<!-- gh-comment-id:1431864062 --> @justchokingaround commented on GitHub (Feb 15, 2023): np here is foot: ![image](https://user-images.githubusercontent.com/44473782/219126596-a1d2e885-2b00-4cff-8141-81ab68a7e376.png) here is wezterm: ![image](https://user-images.githubusercontent.com/44473782/219126680-a6145fc5-bbdb-4e43-bb6a-0ae10fbba8c7.png) and here is patched alacritty lol: ![image](https://user-images.githubusercontent.com/44473782/219126764-3721486b-5990-4007-ac7f-e473594467cd.png) height and width variables are unused: ![image](https://user-images.githubusercontent.com/44473782/219126904-d61eb585-e326-47ef-949b-41ddfdb57733.png)
Author
Owner

@aome510 commented on GitHub (Feb 15, 2023):

Look like the scaling works differently in my terminal compared with yours. Can you experiment with the cover_img_scale config option to see if setting it to different values works for you?

FYI, setting cover_img_scale=1.8 kinda did the job for me with the foot terminal.

Edit: you'll need to git pull to see the new changes.

<!-- gh-comment-id:1431972920 --> @aome510 commented on GitHub (Feb 15, 2023): Look like the scaling works differently in my terminal compared with yours. Can you experiment with the `cover_img_scale` config option to see if setting it to different values works for you? FYI, setting `cover_img_scale=1.8` kinda did the job for me with the `foot` terminal. **Edit**: you'll need to `git pull` to see the new changes.
Author
Owner

@sewnie commented on GitHub (Feb 17, 2023):

needs libsixel library to be installed because spotify_player will dynamically link to it 😔

<!-- gh-comment-id:1434111143 --> @sewnie commented on GitHub (Feb 17, 2023): needs `libsixel` library to be installed because spotify_player will dynamically link to it :pensive:
Author
Owner

@sewnie commented on GitHub (Feb 17, 2023):

image
heres how it looks for me on st, the black borders are a st sixel bug, so it seems to be working fine. i would appreciate a cover_img_spacing, to prevent the characters on the left, and on the right (paused/play icon) from being destroyed.

cover_img_width = 6
cover_img_length = 11
cover_img_scale = 1.4
<!-- gh-comment-id:1434117442 --> @sewnie commented on GitHub (Feb 17, 2023): ![image](https://user-images.githubusercontent.com/47404953/219556029-dd636d5d-67ca-4ff7-a62a-612d07bf989b.png) heres how it looks for me on `st`, the black borders are a `st` sixel bug, so it seems to be working fine. i would appreciate a `cover_img_spacing`, to prevent the characters on the left, and on the right (paused/play icon) from being destroyed. ```toml cover_img_width = 6 cover_img_length = 11 cover_img_scale = 1.4 ```
Author
Owner

@aome510 commented on GitHub (Feb 18, 2023):

needs libsixel library to be installed because spotify_player will dynamically link to it

Yeah, you need libsixel for sixel to work.

i would appreciate a cover_img_spacing, to prevent the characters on the left, and on the right (paused/play icon) from being destroyed

Interesting, does reduce the cover_img_scale variable help?

<!-- gh-comment-id:1435466262 --> @aome510 commented on GitHub (Feb 18, 2023): > needs libsixel library to be installed because spotify_player will dynamically link to it Yeah, you need `libsixel` for `sixel` to work. > i would appreciate a cover_img_spacing, to prevent the characters on the left, and on the right (paused/play icon) from being destroyed Interesting, does reduce the `cover_img_scale` variable help?
Author
Owner

@sewnie commented on GitHub (Feb 18, 2023):

Interesting, does reduce the cover_img_scale variable help?

no matter what, the border characters on the left would always get overridden.

<!-- gh-comment-id:1435481414 --> @sewnie commented on GitHub (Feb 18, 2023): > Interesting, does reduce the cover_img_scale variable help? no matter what, the border characters on the left would always get overridden.
Author
Owner

@aome510 commented on GitHub (Feb 18, 2023):

Should be resolved by #134

<!-- gh-comment-id:1435734843 --> @aome510 commented on GitHub (Feb 18, 2023): Should be resolved by #134
Author
Owner

@sewnie commented on GitHub (Feb 21, 2023):

can someone here and @maya-doshi (sorry for unnecessary ping, just need help from another sixel user) report of Xorg's cpu usage over long periods of time of using spotify-player with sixel? after some time Xorg has alot of cpu usage and memory usage, but not immediately.

i am on st, and this may not be a problem on other terminals which is my question.

<!-- gh-comment-id:1438492700 --> @sewnie commented on GitHub (Feb 21, 2023): can someone here and @maya-doshi (sorry for unnecessary ping, just need help from another sixel user) report of Xorg's cpu usage over long periods of time of using spotify-player with sixel? after some time Xorg has alot of cpu usage and memory usage, but not immediately. i am on st, and this may not be a problem on other terminals which is my question.
Author
Owner

@sewnie commented on GitHub (Feb 21, 2023):

no it's fine, you can just tell me if the sixel feature doesn't affect performance, I cannot tell if this is a libsixel or viuer issue.

<!-- gh-comment-id:1438531146 --> @sewnie commented on GitHub (Feb 21, 2023): no it's fine, you can just tell me if the sixel feature doesn't affect performance, I cannot tell if this is a libsixel or viuer issue.
Author
Owner

@maya-doshi commented on GitHub (Feb 21, 2023):

There is no noticeable or significant impact on performance in my experience

<!-- gh-comment-id:1438569314 --> @maya-doshi commented on GitHub (Feb 21, 2023): There is no noticeable or significant impact on performance in my experience
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#986
No description provided.