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

[sixel] incorrect handling of HLS colors #775

Closed
dnkl opened this issue May 9, 2021 · 3 comments
Closed

[sixel] incorrect handling of HLS colors #775

dnkl opened this issue May 9, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@dnkl
Copy link

dnkl commented May 9, 2021

I was testing sixels in the HLS color space in several terminal emulators and noticed that wezterm doesn't handle them correctly:

wezterm

Environment

  • Linux Wayland
  • wezterm 20210502-154244-3f7122cb

To Reproduce

Run img2sixel -t hls <image>. Compare with img2sixel -t rgb <same image>.

Expected behavior

foot

Additional context

In Sixels, the primary color hues are:

  • blue: 0°
  • red: 120°
  • green: 240°

I suspect wezterm uses

  • red: 0°
  • green: 120°
  • blue: 240°

See https://archive.org/details/bitsavers_decstandar0VideoSystemsReferenceManualDec91_74264381/page/n927/mode/2up, or/and https://vt100.net/docs/vt3xx-gp/chapter2.html#S2.4.2 (scroll down to "Table 2-3 VT340 Default Color Map")

Also worth noting is that XTerm's implementation has issues too, but e.g. mlterm works as expected.

@dnkl dnkl added the bug Something isn't working label May 9, 2021
wez added a commit that referenced this issue May 9, 2021
Two issues here:

* The hue angles need adjusting to work with the palette library
* The resultant RGB color had the wrong gamma level, resulting in
  an overly bright image.

refs: #775
@wez
Copy link
Owner

wez commented May 9, 2021

Thanks for the report! I've pushed a change that fixes this for me!

@dnkl
Copy link
Author

dnkl commented May 9, 2021

Works as far as I can tell. Thanks for the super quick fix!

@dnkl dnkl closed this as completed May 9, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants