3rd / image.nvim

🖼️ Bringing images to Neovim.
MIT License
1.02k stars 42 forks source link

Render same image object multiple times #146

Closed Poly2it closed 5 months ago

Poly2it commented 5 months ago

I am working on a project where it would be very useful if one could render the same image object multiple times on the screen. You would create a single instance of the image object, which could then be stamped multiple times. This is how kitty handles images, so it would make a lot of sense to extend the API in this way. It would also be more performant (I really need performance for the project I'm working on).

3rd commented 5 months ago

Hey, what's your use case & what exactly do you need to optimize? Currently we do some unnecessary things when using Kitty, but I'm trying to get rid of all that in the rewrite. We do attempt to track transmitted images and try not to transmit them again.

Poly2it commented 5 months ago

Hey, what's your use case & what exactly do you need to optimize? Currently we do some unnecessary things when using Kitty, but I'm trying to get rid of all that in the rewrite. We do attempt to track transmitted images and try not to transmit them again.

I am creating a file drawer in which I will need to draw repetitive data, the icons. Perhaps image should more directly mirror the Kitty functionality? Kitty images are very simple, being represented as a single reference integer, so mirroring and exposing that as a core API would contribute a lot of value in simplicity to the project, if you're doing a rewrite anyway.

3rd commented 5 months ago

Definitely not gonna have that API, but if you create another image that has the same source it shouldn't be transmitted twice if you don't clear it "deeply". You can write any abstraction you might find better for your use case on top of the kitty rendering helpers.

Poly2it commented 5 months ago

Definitely not gonna have that API, but if you create another image that has the same source it shouldn't be transmitted twice if you don't clear it "deeply". You can write any abstraction you might find better for your use case on top of the kitty rendering helpers.

Okay.