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

Multiple image support #74

Closed
3rd opened this issue Jun 24, 2023 · 15 comments
Closed

Multiple image support #74

3rd opened this issue Jun 24, 2023 · 15 comments

Comments

@3rd
Copy link

3rd commented Jun 24, 2023

Hey, I'm working on a way to add image support to Neovim, so I picked ueberzugpp as the starting rendering backend and got a nice first version working.

I noticed that there is no multiple image support, and the image identifiers are not really used, when adding an image the canvas is cleared and only that image is rendered, and clear clears everything.

Is multiple image support on the roadmap?

It works great otherwise, and the tmux integration is amazing.
It does crash when sending multiple commands quickly, but that's workable.

Thanks!

@jstkdng
Copy link
Owner

jstkdng commented Jun 24, 2023

Hello, I do have that in the roadmap, but it requires some restructuring of my code so it will take some time. Are you doing like a collage?

It does crash when sending multiple commands quickly, but that's workable.

really? rip

@3rd
Copy link
Author

3rd commented Jun 24, 2023

Ah, awesome!
Not a collage, but trying to render images for document grammars like Markdown.
I might have to write a small "compositor" to manage the images, maybe I could then always spit out a single image, but I was trying to avoid the tmux handling.
Thanks for the project!

image

@jstkdng
Copy link
Owner

jstkdng commented Jun 24, 2023

Nice, though, multiple images won't work with everything. Probably only x11, iterm2 and maybe wayland.

@jstkdng
Copy link
Owner

jstkdng commented Jun 27, 2023

hey, I have a working multiple image implementation for X11 on the refactor1 branch, give it a try.

@3rd
Copy link
Author

3rd commented Jun 27, 2023

@jstkdng Amazing work, thanks a lot!
It's pretty good right now!

ueberzugpp-multi.mp4

Can I contribute with a small change to crop the images? Right now I make sure they never get out of bounds, but this means they get resized.

It would look like this: https://gist.ro/kitty-crop.mp4

Thanks again for your work!

@jstkdng
Copy link
Owner

jstkdng commented Jun 27, 2023

Sure, open a PR and we can look over the changes. Are you using OG ueberzug for testing?

@3rd
Copy link
Author

3rd commented Jun 27, 2023

Sure, open a PR and we can look over the changes. Are you using OG ueberzug for testing?

No, the original won't be supported, just ueberzugpp, kitty graphics protocol and sixels.
Thanks again!

@jstkdng
Copy link
Owner

jstkdng commented Jun 27, 2023

Does kitty and sixel even work on neovim?

@3rd
Copy link
Author

3rd commented Jun 27, 2023

Does kitty and sixel even work on neovim?

Yep, the second link is kitty's normal protocol, but I got one with unicode placeholders working as well. The placeholder one has the same cropping issue, but works with tmux, so I'm considering doing the cropping myself...

@jstkdng
Copy link
Owner

jstkdng commented Jun 27, 2023

How, ueberzugpp's sixel and kitty implementation doesn't work with neovim. Is some configuration required for it to work?

@3rd
Copy link
Author

3rd commented Jun 29, 2023

Hmm, interesting, it works for me, doing it like this: https://github.com/3rd/image.nvim/blob/master/lua/image/backends/kitty/helpers.lua#L42

@3rd
Copy link
Author

3rd commented Jun 30, 2023

@jstkdng
Thanks for all the help, will get back with a cropping PR!

Got the experimental version working and put it out there, there's an ongoing discussion on it here: https://www.reddit.com/r/neovim/comments/14mjsvr/adding_image_support_to_neovim_kitty_tmux_amazing

@3rd 3rd closed this as completed Jun 30, 2023
@jstkdng
Copy link
Owner

jstkdng commented Jun 30, 2023

I see, it seems kitty is only supported with the unicode placeholders.

@3rd
Copy link
Author

3rd commented Jun 30, 2023

I see, it seems kitty is only supported with the unicode placeholders.

Works without placeholders!

@jstkdng
Copy link
Owner

jstkdng commented Jun 30, 2023

Hmmmm, unless the neovim terminal is somehow different than editor buffers then I don't understand. ueberzugpp also supports kitty, can you test with your software outside of tmux and check if ueberzugpp's kitty/sixel implementation works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants