pull/5/head
TheRealOrange 2022-02-22 23:49:20 +08:00
rodzic fb4fc6687e
commit 949e5714c2
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: E155025E350A1A4B
1 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
## Introduction
This is a cursed terminal video player. This improves on some previous designs by implementing some optimisations such as not changing the text/background colour if the next pixel is similar enough. The video player also manages to get 4 pixels (effectively) out of every character as opposed to the usual 2 pixels by using the unicode quarter block characters.
This is a cursed terminal video player. This improves on some previous designs by implementing some optimisations such as not changing the text/background colour if the next pixel is similar enough. The video player also manages to get 8 "pixels" (effectively) out of every character as opposed to the usual 2 pixels by using the unicode quarter block characters. The pixels aren't really independent, each character is still limited to two colours.
Mileage may vary depending on how fast your terminal is. In my testing, I've found that [alacritty](https://github.com/alacritty/alacritty) works rather well.
@ -39,12 +39,14 @@ Clearly there is potential here. By using the unicode quarter block characters,
- ▞ (U+259E 1uadrant upper right and lower left)
- ▄ (U+2584 lower half block)
- ▐ (U+2590 right half block)
- ▂ (U+2582 lower quarter block)
- ▆ (U+2586 lower 3 quarters block)
We have all the building blocks for effectively double the horizontal resolution! However, we are still limited to two colours per pixel. So, we pick the configuration that minimizes the maximum difference between colours which will be made the same, and then set the colour to the average colour.
We have all the building blocks for effectively double the horizontal and vertical resolution! However, we are still limited to two colours per pixel. So, we pick the configuration that minimizes the maximum difference between colours which will be made the same, and then set the colour to the average colour.
Other optimisations include
- only changing pixels whose colour have changed a certain value
- only inputting the ANSI code for cursor move when the next pixel isnt contiguous
- only inputting the ANSI code for cursor move when the next pixel isn't contiguous
- only inputting the ANSI code for background colour change when the background colour differs significantly (set as a compile option)