-
-
Notifications
You must be signed in to change notification settings - Fork 992
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
background image #163
Comments
Not something I care about, personally. But it should be trivial to implement. Patches welcome. |
Would love if this had a toggle for current wallpaper + dim. Only feature keeping me from |
+1 need Fallout PipBoy-terminal background image support... going fully transparent against the desktop wallpaper results in horribly broken anti-aliasing and looks like garbage on MacOS. (On a side note - defaulting to pure-black background hurts peoples eyes. You can't focus in to a black-hole, and you should have something for the eyes to focus on if you want to avoid eye-strain... a nice grey would be a better default, imho) If I find time, I'll try to work on this. Are there PNG and JPG image loaders already in the codebase? |
@teratorn #1005 describes your anti-aliasing issue. |
@teratorn kitty already links against libpng and uses it for its graphics protocol. just search for the png headers to see where and how it is used. As for staring into black, I strongly disagree. I find it very relaxing for my eyes. Not to mention that monitors displaying a black color are not black holes, they still emit light. |
I've just swapped to using kitty today and I'm loving it; much better than all the other options I've tried in linux. I came here to ask for exactly this feature since I like having pokemon images in my terminal like a nerd. If it's something you think is trivial to implement @kovidgoyal I'll gladly have a crack at it sometime soon if you can give me some vague pointers about where to be looking in your codebase to build it. I'm a python dev but not a C dev so I might scratch my head a bit if it involves much C. |
Well, this will definitely require a fair bit of C code. You will need to load the PNG image usingthe same code that does it for kitty's exisint image display capabilities (see grahoics.c) and then display it in the kitty graphics shader in shaders.c. This will all be C code, I'm afraid. |
I need coins |
will this ever be done? |
What about an option to specify an alternate background color for inactive windows? I'd like to use less opacity on my inactive windows, to let backgrounds show through... Did I miss an option to do this? |
@disruptek that question is not related to background image. Please open a new issue so we can keep this thread focused on one specific request (all be it a pipe dream at this point). |
@disruptek you can partway do that if you run inside tmux and set the colours appropriately |
I have been trying for hours to enable backgroundimage=yes in both the .ini file and using the registry. Can someone tell me how to enable this feature? If this feature is not yet available, how is the screenshot on this page possible? |
@miaXcova this is a wrong kitty. here's the one you're looking for https://github.com/cyd01/KiTTY/ |
I did a bit of looking into this, as many have asked for this feature, and while I think it's cool, I don't think it essential. But I'm happy to work on something many people want as long as it's cool—after the failure of #2259, I think it best I work on things that will actually be of the greatst practical benefit for Kitty's users. After all, my work is supported by grant. Obviously, as @kovidgoyal mentioned, the best way in is through the existing Kitty graphics protocol. So I dug around in The One missing ingredient I can think of is that z-index is only defined as "integer" - this is a big problem for interoperability if we want to put an image at the bottom below which no image can be drawn, because I don't know if it's a Python integer, or if it's a C integer, if a certain size is guaranteed, and the spec doesn't specify. However, once we clear up that problem...I don't think C is really necessary... |
You cant use the graphics protocol for this, as that means doing a clear |
If it's not possible to hook this, it would need to be made so |
On Wed, Jan 08, 2020 at 01:59:24AM -0800, Fredrick Brennan wrote:
> Hook screen clearing event to do this again whenever needed.
If it's not possible to hook this, it would need to be made so
There are many such events, as well as many ways to clear images in the
graphical protocol as well. It should certainly be possible to tag an
image as "undeletable" but this seems like a hack. It means that onehas
to make sure all the various ways that exist of deleting images dont
delete the special image, search graphics.c for clear and delete to see
how many there are. And there there is the whole alternate screen thing.
One has to make sure the background image remains visible when swapping
between main and alternate screen.
Why not just have a special slot for a background image? I know you dont
mind writing a bit of C :))
|
I don't mind :) I guess I'll just add it to GraphicsManager struct, then allocate it as needed in grman_alloc (based on something I'll probably add to global state)...the type can be |
On Wed, Jan 08, 2020 at 02:23:06AM -0800, Fredrick Brennan wrote:
I don't mind :)
I guess I'll just add it to GraphicsManager struct, then allocate it as needed in grman_alloc (based on something I'll probably add to global state)...the type can be `Image *`...the thing is scaling, not sure how I'll do that, as the example code uses ImageMagick. And surely some users are going to want tiling and not scaling. And I also have to think about DPI
Yeah there are a lot of details to consider, which is why I never
bothered with tackling this issue. You also need to consider what
a background image means w.r.t. multiple windows in a tab, tab bar,
borders, margins, padding, etc.
|
Clearly many people want this, so I will have a draft PR by the end of the week. I'll let you know if I think a choice I make could be controverisal before I make it so no code is wasted. There's a lot to consider but it's worth it! Towards making |
On Wed, Jan 08, 2020 at 02:40:13AM -0800, Fredrick Brennan wrote:
Clearly many people want this, so I will either have a draft PR by the end of the week.
Cool, I look forward to it.
I'll let you know if I think a choice I make could be controverisal before I make it so no code is wasted.
Am happy to discuss if so. And am also happy to make fixups in your PR
myself if needed, so you wont have to revisit the code. As I did for
your OpenType PR.
There's a lot to consider but it's worth it! Towards making `kitty` the most complete terminal. `alacritty`, `termite` etc move out of the way, there's a new king in town 👑 😂
There are other terminals besides kitty!! Who knew :))
|
Would this mean that this KiTTY would be a fork of the other KiTTY from a certain place in time, or do both share the same base code with minor changes? Would the real Slim KiTTY please stand up... please stand up... Also, to clarify what I was hoping for with a background image (image or solid color) would have been to change the opacity so that the background transparency could be controlled while the text and window frame remained at full visibility. The way transparency works now is it changes the entire window text, frame and all. It's just nice to be able to see through windows when most of the window will be black anyway. Rocking 6 monitors and still never enough screen real estate. |
We have nothing to do with the cyd01 kitty. Background opacity isn't really on the table here. The image can be made opaque...on Kitty's default background, usually black. We'll have to figure out background opacity in another issue, this really is not the place to discuss it. |
On Wed, Jan 08, 2020 at 04:44:35AM -0800, Fredrick Brennan wrote:
Background opacity isn't really on the table here. The image can be made opaque...on Kitty's default background, usually black. We'll have to figure out background opacity in another issue, this really is not the place to discuss it.
Actually, kitty already has background_opacity (see kitty.conf) no
reason it should not apply to the background image as well.
|
yes there is a remote control command to change background image. |
Sorry, little late to the party. Will portion of the image change depending on where the terminal is open on the window? To simulate "pseudo-transparency" for the wallpaper. |
No. kitty has real transparency, use it. |
Without a compositor? Some people can't use them. :\ |
On Fri, Apr 10, 2020 at 09:42:41AM -0700, Codey Oxley wrote:
Without a compositor? Some people can't use them. :\
That's a pity, but I'm afraid not one I think terminal emulators should
be in the business of compensating for.
|
The idea of scaling the image to the size of the monitor, and then having the terminal window act as a "viewport", is somewhat appealing to me. I don't think it necessarily needs to be meant to replace a compositor. If you want tips in implementing it @coxley, I can give you some |
When I add option background_image in my kitty.conf, but it doesn't work. |
Did you make sure to use a PNG image? Other formats like JPEG don't work. |
I did use PNG. |
This is what I have. |
Did you restart kitty after changing the config? Post the output of |
|
Your version of kitty is too old. The background image feature was introduced in 0.17.0 and you're using 0.14.3. Either try to update your Ubuntu to a version which has a newer kitty or see https://sw.kovidgoyal.net/kitty/binary.html. |
The newest version is 0.14.3. |
The newest version of kitty in Ubuntu eoan (19.10) is 0.14.3. In Ubuntu focal (20.04LTS) it's 0.15.0 and in Ubuntu groovy, which hasn't been released yet, it will be 0.17.3. Just uninstall kitty with |
That'd be perfect, @ctrlcctrlv :) |
I second this. I can use a comp manager but don't want to. I much prefer pseudo-transparency a-la urxvt for both performance and aesthetic reasons. |
Is there a way to clamp the background and center the image? |
In the nightly version (master branch), you can use the following configuration.
|
Is this feature released into the main download release yet? |
@ramanshsharma2806 yes |
Thank you for the reply @Arrow-x. Can I change this permanently in the |
On Sun, May 08, 2022 at 09:41:37PM -0700, Arrow-x wrote:
@ramanshsharma2806 yes
question, can you change the background on the fly?? with a command?
|
Thank you. |
@ramanshsharma2806 |
Was anchor never implemented after all? As of right now it seems like moving the image while in clamped layout is impossible. |
There was a PR for this feature that was merged and later reverted. The background image can be centered (clamped) with the nightly release.
Do you think this configuration option I think it makes sense to allow tiled images to be centered.
Also the background image can be centered at the bottom with |
I'm not a fan of another option for this. Just add keywords tiled-centered, north, south, east, west, north-east, north-west, etc to background_image_layout. I will accept a PR that does that |
aha, having looked into it more I can see why you went with window logo. That together with what's in the nightly build right now should cover most situations. |
now that we can show images in the kitty terminal (awesome), can we get support for background images?
The text was updated successfully, but these errors were encountered: