-
Notifications
You must be signed in to change notification settings - Fork 637
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
Add background image support for OpenGL #4226
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic work. I've left some review comments but overall this is looking good.
d2ff147
to
2e90cef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good to me!
2e90cef
to
2b64e69
Compare
@mitchellh, could you take a look at this? Are there any other changes needed here, or is it ready to go? |
7dcc77d
to
404f947
Compare
Ohhhh I can't wait for this to get in! |
Amazing work here, thank you very much! And though it's kinda late to ask for such changes may I suggest another option for background-image-mode. The way it should work is that the image is placed in the center, scaled to fill all the window background while preserving aspect ratio, and if the aspect ratio of the image doesn't match one of the terminal window, the part of the image that exceeds the window gets cut off (maybe name it "cropped" mode.) For reference I can suggest MacOS wallpaper modes:
I know it's a lot and I'd gladly implement it myself, but I'm barely familiar with Zig and have zero experience with shaders. |
Thank you so much!
I think that's a pretty nice mode. I've just implemented it, and as you requested, the mode's name is Here is a video demonstrating how the mode acts when the terminal is resized: Ghostty.Cropped.Mode.mp4The video quality is pretty bad, but hope is sufficient for demonstration purposes.
Thanks a lot for commenting again, I think it is a pretty nice feature! |
Partially fixes #3645.
Ghostty.Background.Image.Demo.Scaled.mp4
I apologize for the video quality - GitHub limits videos to be less than 10MB.
This PR adds support for setting background image dynamically for OpenGL only. Metal still needs its own implementation.
Because the only way to read the image data and decode to RGB/RGBA so that it is ready to be uploaded to the GPU is to use
kitty.terminal.graphics
with the project's current state, we only support PNG.