I've been attempting to draw simulations in the terminal and classic ANSI coloring has become too small-resolution and slow for me. I want to draw individual pixels to represent my simulation instead of using full characters. Sixel looks to be an option for this but the Kitty Graphics Protocol appears to be faster. However, I can't find a way to implement the Kitty Graphics Protocol.
I've tried looking at various online sources but none appear to show how to use an array of pixels to display the image. Most just reference an image file and display it. I'm sure that this is possible to since it's mentioned in documentation, but I can't find an example of it being done.
The payload should be the ASCII code of the characters from 0 to 255 for r, g, and b. Fro example, ~
would be 126 and i
would be 151. One pixel in the payload should have 3 characters to represent RGB. This payload should then be transferred to base 64 encoding and printed. An example would look like: \x1b_Ga=t,f=24,s=10,v=1;ISF+ISF+ISF+ISF+ISF+ISF+ISF+ISF+ISF+ISF+\x1b\\\n
You can use a website like https://www.ascii-code.com/ to get the ASCII codes of the characters.