Kitty graphic is color shifted for me (like RGB instead of BGR) · Issue #5 · mmulet/term.everything · GitHub
Skip to content

Kitty graphic is color shifted for me (like RGB instead of BGR) #5

Open
1 of 2 issues completed
Open

Description

@X-Ryl669

Also, it doesn't seem to render 1px for 1px, there's a huge scaling involved.
This happens with both kitty and wezterm terminal.

My terminal (wezterm) emulates both kitty and iterm2 protocol to display images, but term.everything doesn't detect this. I can "force" kitty by running
TERM="xterm-kitty" ./term.everything thunderbird but I can't force iterm2 mode either.

Activity

  1. mmulet commented on Sep 11, 2025

    @mmulet
    Owner

    Yep, I flip to bgr on purpose for the kitty editor:

    On my system while using kitty it requires the bgr flip. But, I guess I need an exception for code that is kitty compatible, but not actually kitty term.

  2. hpjansson commented on Sep 11, 2025

    @hpjansson
    Collaborator

    Hmmm. You should only have to specify the correct input buffer format, and the effect should be the same in both symbols, sixels and kitty modes. Chafa should take it from there.

    Could this be a bug in your terminal, @mmulet? Are you both on little-endian systems?

  3. mmulet commented on Sep 11, 2025

    @mmulet
    Owner

    Hmmm. You should only have to specify the correct input buffer format, and the effect should be the same in both symbols, sixels and kitty modes. Chafa should take it from there.

    Could this be a bug in your terminal, @mmulet? Are you both on little-endian systems?

    I will update kitty and see if it's fixed. I'm on plain old little-endian, (i9-13900K)

  4. X-Ryl669 commented on Sep 11, 2025

    @X-Ryl669
    Author

    Nope, even on Kitty itself it's flipped. I'm using Wayland, BTW, not X11.

  5. hpjansson commented on Sep 11, 2025

    @hpjansson
    Collaborator

    Sounds like we should investigate why you're getting different results on the same terminal (AFAIU @mmulet requires flip, but @X-Ryl669 does not). My first guess would be that the texture_pixels buffer captured by term.everything can be in different formats, and the pixel format arg just has to match it correctly.

  6. mmulet commented on Sep 11, 2025

    @mmulet
    Owner

    I know on my machine at least, there was a difference in whether the host machine was running Wayland or x11 , (thus the session_type_is_x11 check). Maybe that has been fixed and there is no need to flip now?

    I have to do day job work now, I'll be back in a few hours.

  7. Mervius commented on Oct 12, 2025

    @Mervius

    Any word of this? I noticed that the red and blue colours were swapped in my terminal(kitty) and saw this issue, but it's been a while.

    Would it be possible to just add a colour format selector option so that users can manually choose it themselves if whatever is default isn't right?

  8. Mervius commented on Oct 12, 2025

    @Mervius

    Yep, I flip to bgr on purpose for the kitty editor:

    term.everything/c_interop/src/ChafaInfo.cpp

    Line 11 in f8c8527
    pixel_mode == CHAFA_PIXEL_MODE_KITTY && !session_type_is_x11 ? CHAFA_PIXEL_RGBA8_UNASSOCIATED : CHAFA_PIXEL_BGRA8_UNASSOCIATED,

    On my system while using kitty it requires the bgr flip. But, I guess I need an exception for code that is kitty compatible, but not actually kitty term.

    Also, here you say you swap to BGR on kitty, but this seems to be doing the opposite? Swapping the two results of that ternary operator fixes the issue for me.

  9. mmulet commented on Oct 12, 2025

    @mmulet
    Owner

    Any word of this? I noticed that the red and blue colours were swapped in my terminal(kitty) and saw this issue, but it's been a while.

    Would it be possible to just add a colour format selector option so that users can manually choose it themselves if whatever is default isn't right?

    Sorry, I've been really busy irl. I think the flag is a good workaround for now. I'll make sure that gets done today.

  10. mmulet commented on Oct 12, 2025

    @mmulet
    Owner

    While not a fix, I added a work-aound in Beta release 0.5.4.

    See the updated help.md for the new options to change the pixel mode (BGR,RGB,etc) so that it will work on your system.

    I'm still interested in finding a real fix to this issue, so I'm keeping this issue open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions